]> granicus.if.org Git - python/commitdiff
Use absolute imports
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 3 Apr 2006 04:45:34 +0000 (04:45 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 3 Apr 2006 04:45:34 +0000 (04:45 +0000)
Lib/compiler/__init__.py
Lib/compiler/ast.py
Lib/compiler/transformer.py
Lib/test/test_dict.py
Lib/test/test_import.py
Lib/test/test_sets.py
Lib/test/test_urllib2.py

index 13b05bfbe2274f39585ba297383b72843c7c694b..ce89144b73358eced1c79754fb5f490421cab763 100644 (file)
@@ -21,6 +21,6 @@ compileFile(filename)
     Generates a .pyc file by compiling filename.
 """
 
-from transformer import parse, parseFile
-from visitor import walk
-from pycodegen import compile, compileFile
+from compiler.transformer import parse, parseFile
+from compiler.visitor import walk
+from compiler.pycodegen import compile, compileFile
index 08e0c6a4460cb6501131aff1213f064ef37b2840..8dcdf68ada373c716e10aa8f4185831050e4cff5 100644 (file)
@@ -2,7 +2,7 @@
 
 This file is automatically generated by Tools/compiler/astgen.py
 """
-from consts import CO_VARARGS, CO_VARKEYWORDS
+from compiler.consts import CO_VARARGS, CO_VARKEYWORDS
 
 def flatten(seq):
     l = []
index cc91b4f10ce5191cd4bbfa296352e669df0e99cf..8225dfa3fe52af71ecac5840176709457ff45c7a 100644 (file)
@@ -34,8 +34,8 @@ import sys
 class WalkerError(StandardError):
     pass
 
-from consts import CO_VARARGS, CO_VARKEYWORDS
-from consts import OP_ASSIGN, OP_DELETE, OP_APPLY
+from compiler.consts import CO_VARARGS, CO_VARKEYWORDS
+from compiler.consts import OP_ASSIGN, OP_DELETE, OP_APPLY
 
 def parseFile(path):
     f = open(path, "U")
index f3f78e79dc3705f54efa24bcb55d3c6c5d2b961f..bbca79886c8d689250f55a53188fbadb2f96f59b 100644 (file)
@@ -445,7 +445,7 @@ class DictTest(unittest.TestCase):
             self.fail_("g[42] didn't raise KeyError")
 
 
-import mapping_tests
+from test import mapping_tests
 
 class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
     type2test = dict
index 72f27fad90a3a89c739b97437d0ac29b9df09e61..a72b8bd072d8d7141e8c47c1d4c4db7302d8f843 100644 (file)
@@ -15,7 +15,7 @@ else:
     raise TestFailed("import of RAnDoM should have failed (case mismatch)")
 
 # Another brief digression to test the accuracy of manifest float constants.
-import double_const  # don't blink -- that *was* the test
+from test import double_const  # don't blink -- that *was* the test
 
 def remove_files(name):
     for f in (name + os.extsep + "py",
index ff834e0aa0d7ab64e98c1f7b883c2e30713a32b3..85e4a22e840a4b8577c06baebf698b0a856b99ee 100644 (file)
@@ -819,7 +819,8 @@ Set(['Jack', 'Jane', 'Janice', 'John', 'Marvin', 'Sam', 'Zack'])
 __test__ = {'libreftest' : libreftest}
 
 def test_main(verbose=None):
-    import test_sets, doctest
+    import doctest
+    from test import test_sets
     test_support.run_unittest(
         TestSetOfSets,
         TestExceptionPropagation,
index 58b54c1f9a0cede16d0d9f74b0270ff3438b91c8..64a2ee960ef364f158b15ccb68c4cc452b4fd464 100644 (file)
@@ -632,7 +632,7 @@ class HandlerTests(unittest.TestCase):
         from urllib2 import build_opener, HTTPHandler, HTTPError, \
              HTTPCookieProcessor
 
-        from test_cookielib import interact_netscape
+        from test.test_cookielib import interact_netscape
 
         cj = CookieJar()
         interact_netscape(cj, "http://www.example.com/", "spam=eggs")