allow importing from a module named None if it has an 'as' clause

This commit is contained in:
Benjamin Peterson 2009-06-13 13:06:21 +00:00
parent 565e1b6bb7
commit d1f5a59edb
2 changed files with 8 additions and 4 deletions

View file

@ -281,6 +281,8 @@ if 1:
self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'exec')
# This is ok.
compile("from None import x", "tmp", "exec")
compile("from x import None as y", "tmp", "exec")
compile("import None as x", "tmp", "exec")
def test_import(self):
succeed = [