[pypy-svn] r19003 - in pypy/dist/pypy/interpreter: . astcompiler pyparser

mwh at codespeak.net mwh at codespeak.net
Wed Oct 26 13:32:03 CEST 2005


Author: mwh
Date: Wed Oct 26 13:31:59 2005
New Revision: 19003

Modified:
   pypy/dist/pypy/interpreter/astcompiler/pyassem.py
   pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
   pypy/dist/pypy/interpreter/astcompiler/symbols.py
   pypy/dist/pypy/interpreter/baseobjspace.py
   pypy/dist/pypy/interpreter/function.py
   pypy/dist/pypy/interpreter/gateway.py
   pypy/dist/pypy/interpreter/module.py
   pypy/dist/pypy/interpreter/pycode.py
   pypy/dist/pypy/interpreter/pycompiler.py
   pypy/dist/pypy/interpreter/pyframe.py
   pypy/dist/pypy/interpreter/pyopcode.py
   pypy/dist/pypy/interpreter/pyparser/error.py
   pypy/dist/pypy/interpreter/typedef.py
Log:
suggestions from 'importfun' about interpreter: remove unused
imports, change some imports to import from the module that
defines the name, not some other module that also imports it.


Modified: pypy/dist/pypy/interpreter/astcompiler/pyassem.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/pyassem.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/pyassem.py	Wed Oct 26 13:31:59 2005
@@ -2,7 +2,6 @@
 
 import dis
 import sys
-import types
 
 from pypy.interpreter.astcompiler import misc, ast
 from pypy.interpreter.astcompiler.consts \

Modified: pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	Wed Oct 26 13:31:59 2005
@@ -3,8 +3,6 @@
 import marshal
 import struct
 import sys
-import types
-from cStringIO import StringIO
 
 from pypy.interpreter.astcompiler import ast, parse, walk, syntax
 from pypy.interpreter.astcompiler import pyassem, misc, future, symbols

Modified: pypy/dist/pypy/interpreter/astcompiler/symbols.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/symbols.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/symbols.py	Wed Oct 26 13:31:59 2005
@@ -6,7 +6,6 @@
 from pypy.interpreter.astcompiler.misc import mangle, Counter
 from pypy.interpreter.pyparser.error import SyntaxError
 from pypy.interpreter import gateway
-import types
 
 
 import sys

Modified: pypy/dist/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/dist/pypy/interpreter/baseobjspace.py	Wed Oct 26 13:31:59 2005
@@ -584,7 +584,6 @@
         """ NOT_RPYTHON """
         space = cache.space
         # XXX will change once we have our own compiler 
-        from pypy.interpreter.pycode import PyCode
         import py
         source = source.lstrip()
         assert source.startswith('('), "incorrect header in:\n%s" % (source,)

Modified: pypy/dist/pypy/interpreter/function.py
==============================================================================
--- pypy/dist/pypy/interpreter/function.py	(original)
+++ pypy/dist/pypy/interpreter/function.py	Wed Oct 26 13:31:59 2005
@@ -9,7 +9,6 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.eval import Code
-from pypy.interpreter.gateway import NoneNotWrapped
 
 class Function(Wrappable):
     """A function is a code object captured with some environment:

Modified: pypy/dist/pypy/interpreter/gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/gateway.py	(original)
+++ pypy/dist/pypy/interpreter/gateway.py	Wed Oct 26 13:31:59 2005
@@ -790,7 +790,6 @@
                            return x+y
                     ''')
     """ 
-    from pypy.interpreter.pycode import PyCode
     if not isinstance(source, str): 
         source = str(py.code.Source(source).strip())
         assert source.startswith("def "), "can only transform functions" 

Modified: pypy/dist/pypy/interpreter/module.py
==============================================================================
--- pypy/dist/pypy/interpreter/module.py	(original)
+++ pypy/dist/pypy/interpreter/module.py	Wed Oct 26 13:31:59 2005
@@ -3,7 +3,6 @@
 """
 
 from pypy.interpreter.baseobjspace import Wrappable
-from pypy.interpreter.error import OperationError
 
 class Module(Wrappable):
     """A module."""

Modified: pypy/dist/pypy/interpreter/pycode.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycode.py	(original)
+++ pypy/dist/pypy/interpreter/pycode.py	Wed Oct 26 13:31:59 2005
@@ -9,7 +9,6 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import NoneNotWrapped 
 from pypy.interpreter.baseobjspace import ObjSpace, W_Root 
-from pypy.tool.cache import Cache 
 
 # helper
 

Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py	(original)
+++ pypy/dist/pypy/interpreter/pycompiler.py	Wed Oct 26 13:31:59 2005
@@ -4,8 +4,6 @@
 """
 from codeop import PyCF_DONT_IMPLY_DEDENT
 from pypy.interpreter.error import OperationError
-from pypy.rpython.objectmodel import we_are_translated
-import os
 
 class AbstractCompiler:
     """Abstract base class for a bytecode compiler."""

Modified: pypy/dist/pypy/interpreter/pyframe.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyframe.py	(original)
+++ pypy/dist/pypy/interpreter/pyframe.py	Wed Oct 26 13:31:59 2005
@@ -1,7 +1,7 @@
 """ PyFrame class implementation with the interpreter main loop.
 """
 
-from pypy.interpreter import eval, baseobjspace, gateway
+from pypy.interpreter import eval, baseobjspace
 from pypy.interpreter.miscutils import Stack, FixedStack
 from pypy.interpreter.error import OperationError
 from pypy.interpreter import pytraceback

Modified: pypy/dist/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyopcode.py	(original)
+++ pypy/dist/pypy/interpreter/pyopcode.py	Wed Oct 26 13:31:59 2005
@@ -4,7 +4,7 @@
 pyfastscope.py and pynestedscope.py.
 """
 
-from pypy.interpreter.baseobjspace import OperationError, BaseWrappable
+from pypy.interpreter.error import OperationError
 from pypy.interpreter.baseobjspace import UnpackValueError
 from pypy.interpreter import gateway, function
 from pypy.interpreter import pyframe, pytraceback

Modified: pypy/dist/pypy/interpreter/pyparser/error.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/error.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/error.py	Wed Oct 26 13:31:59 2005
@@ -1,4 +1,3 @@
-from pypy.interpreter.error import OperationError
 
 class SyntaxError(Exception):
     """Base class for exceptions raised by the parser."""

Modified: pypy/dist/pypy/interpreter/typedef.py
==============================================================================
--- pypy/dist/pypy/interpreter/typedef.py	(original)
+++ pypy/dist/pypy/interpreter/typedef.py	Wed Oct 26 13:31:59 2005
@@ -2,10 +2,11 @@
 
 
 """
-from pypy.interpreter.gateway import interp2app, ObjSpace, Arguments, W_Root 
-from pypy.interpreter.baseobjspace import BaseWrappable, Wrappable
+from pypy.interpreter.gateway import interp2app
+from pypy.interpreter.argument import Arguments
+from pypy.interpreter.baseobjspace import \
+     BaseWrappable, Wrappable, W_Root, ObjSpace
 from pypy.interpreter.error import OperationError
-from pypy.tool.cache import Cache
 from pypy.tool.sourcetools import compile2
 from pypy.rpython.objectmodel import instantiate
 



More information about the Pypy-commit mailing list