diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-13 20:23:33 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-13 20:23:33 (GMT) |
commit | a72be3b325ef207fdf16cdae1cdd9b0f3e349efd (patch) | |
tree | 31243e5321cf56d4d933942a8d4f9945c182f706 /Lib/test/test_ast.py | |
parent | 52c4bec76bdcb962e883eac1e55f98df488b558c (diff) | |
download | cpython-a72be3b325ef207fdf16cdae1cdd9b0f3e349efd.zip cpython-a72be3b325ef207fdf16cdae1cdd9b0f3e349efd.tar.gz cpython-a72be3b325ef207fdf16cdae1cdd9b0f3e349efd.tar.bz2 |
when no module is given in a 'from' relative import, make ImportFrom.module NULL
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index eac42d3..89850f6 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -152,6 +152,10 @@ class AST_Tests(unittest.TestCase): self.assertIsNone(slc.lower) self.assertIsNone(slc.step) + def test_from_import(self): + im = ast.parse("from . import y").body[0] + self.assertIsNone(im.module) + def test_nodeclasses(self): x = ast.BinOp(1, 2, 3, lineno=0) self.assertEquals(x.left, 1) |