Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd745cc commit 0a5bd51Copy full SHA for 0a5bd51
1 file changed
Lib/test/test_ast.py
@@ -548,6 +548,17 @@ def test_bad_integer(self):
548
compile(mod, 'test', 'exec')
549
self.assertIn("invalid integer value: None", str(cm.exception))
550
551
+ def test_level_as_none(self):
552
+ body = [ast.ImportFrom(module='time',
553
+ names=[ast.alias(name='sleep')],
554
+ level=None,
555
+ lineno=0, col_offset=0)]
556
+ mod = ast.Module(body)
557
+ code = compile(mod, 'test', 'exec')
558
+ ns = {}
559
+ exec(code, ns)
560
+ self.assertIn('sleep', ns)
561
+
562
563
class ASTValidatorTests(unittest.TestCase):
564
0 commit comments