home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / lib2to3 / fixes / fix_input.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.1 KB  |  22 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''Fixer that changes input(...) into eval(input(...)).'''
  5. from  import fixer_base
  6. from fixer_util import Call, Name
  7. from  import patcomp
  8. context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >")
  9.  
  10. class FixInput(fixer_base.BaseFix):
  11.     PATTERN = "\n              power< 'input' args=trailer< '(' [any] ')' > >\n              "
  12.     
  13.     def transform(self, node, results):
  14.         if context.match(node.parent.parent):
  15.             return None
  16.         new = node.clone()
  17.         new.set_prefix('')
  18.         return Call(Name('eval'), [
  19.             new], prefix = node.get_prefix())
  20.  
  21.  
  22.