[pypy-svn] r25680 - pypy/dist/pypy/translator

tismer at codespeak.net tismer at codespeak.net
Tue Apr 11 01:49:51 CEST 2006


Author: tismer
Date: Tue Apr 11 01:49:49 2006
New Revision: 25680

Modified:
   pypy/dist/pypy/translator/simplify.py
Log:
allow removal of unused imports.

Reason: constant imports detected during flowing.

XXX maybe it is better to not do this statically, but carry a list of things
to be cleaned up which became useless after flowing? Maybe in the space instance or graph?

Modified: pypy/dist/pypy/translator/simplify.py
==============================================================================
--- pypy/dist/pypy/translator/simplify.py	(original)
+++ pypy/dist/pypy/translator/simplify.py	Tue Apr 11 01:49:49 2006
@@ -449,6 +449,7 @@
 CanRemoveBuiltins = {
     isinstance: True,
     hasattr: True,
+    __import__: True, # imports for side-effects must store the result
     }
 
 def transform_dead_op_vars_in_blocks(blocks, translator=None):



More information about the Pypy-commit mailing list