pypy / pypy / translator / backendopt /

Diff from to

File pypy/translator/backendopt/

-from pypy.objspace.flow.model import Constant, Variable, SpaceOperation
-from pypy.objspace.flow.model import c_last_exception
-from pypy.objspace.flow.model import mkentrymap
-from import log
-from pypy.translator.simplify import eliminate_empty_blocks
+from pypy.objspace.flow.model import (Constant, Variable, SpaceOperation,
+    c_last_exception, mkentrymap)
+from pypy.rpython.lltypesystem import lltype
+from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.translator.unsimplify import insert_empty_block, split_block
-from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.rpython.lltypesystem import lltype
 def fold_op_list(operations, constants, exit_early=False, exc_catch=False):
                 except (KeyboardInterrupt, SystemExit):
-                except Exception, e:
+                except Exception:
                     pass   # turn off reporting these as warnings: useless
                     #log.WARNING('constant-folding %r:' % (spaceop,))
                     #log.WARNING('  %s: %s' % (e.__class__.__name__, e))
 def constant_fold_block(block):
     constants = {}
     block.operations = fold_op_list(block.operations, constants,
-                           exc_catch = block.exitswitch == c_last_exception)
+                           exc_catch=block.exitswitch == c_last_exception)
     if constants:
         if block.exitswitch in constants:
             switch = constants[block.exitswitch].value
         if same_as:
     return count
 def constant_fold_graph(graph):
     # first fold inside the blocks
     for block in graph.iterblocks():
                     constants[v2] = v1
             if constants:
                 prepare_constant_fold_link(link, constants, splitblocks)
-        if  splitblocks:
+        if splitblocks:
             rewire_links(splitblocks, graph)
         if not diffused and not splitblocks:
             break # finished