summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_compile.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 78215d2..4e15d8c 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -270,11 +270,17 @@ if 1:
'(a, None) = 0, 0',
'for None in range(10): pass',
'def f(None): pass',
+ 'import None',
+ 'import x as None',
+ 'from x import None',
+ 'from x import y as None'
]
for stmt in stmts:
stmt += "\n"
self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'single')
self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'exec')
+ # This is ok.
+ compile("from None import x", "tmp", "exec")
def test_import(self):
succeed = [