summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2008-10-30 20:18:13 (GMT)
committerThomas Heller <theller@ctypes.org>2008-10-30 20:18:13 (GMT)
commit1fac5a450562c50a3b7121598da7f010a306e50f (patch)
tree9bbe61db122422c7c67c1e1b1f7f5ae3d587ce18 /Lib/test
parent9f616f48caaa2c5ef8a1a1a317b41c1d53e06198 (diff)
downloadcpython-1fac5a450562c50a3b7121598da7f010a306e50f.zip
cpython-1fac5a450562c50a3b7121598da7f010a306e50f.tar.gz
cpython-1fac5a450562c50a3b7121598da7f010a306e50f.tar.bz2
Fixed a modulefinder crash on certain relative imports.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_modulefinder.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py
index b62758a..9d7f76a 100644
--- a/Lib/test/test_modulefinder.py
+++ b/Lib/test/test_modulefinder.py
@@ -190,6 +190,19 @@ a/b/c/e.py
a/b/c/f.py
"""]
+relative_import_test_3 = [
+ "a.module",
+ ["a", "a.module"],
+ ["a.bar"],
+ [],
+ """\
+a/__init__.py
+ def foo(): pass
+a/module.py
+ from . import foo
+ from . import bar
+"""]
+
def open_file(path):
##print "#", os.path.abspath(path)
dirname = os.path.dirname(path)
@@ -256,6 +269,9 @@ class ModuleFinderTest(unittest.TestCase):
def test_relative_imports_2(self):
self._do_test(relative_import_test_2)
+ def test_relative_imports_3(self):
+ self._do_test(relative_import_test_3)
+
def test_main():
distutils.log.set_threshold(distutils.log.WARN)
test_support.run_unittest(ModuleFinderTest)