diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-05-15 21:17:25 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-05-15 21:17:25 (GMT) |
commit | 1e93b060077db01ceca0cdbad00ff358fee6f104 (patch) | |
tree | a9812ecd17301e563a020e9d122e6a52d3b7fa3a /Lib | |
parent | c032f16d181203e5df458b09c4583a6389f78331 (diff) | |
download | cpython-1e93b060077db01ceca0cdbad00ff358fee6f104.zip cpython-1e93b060077db01ceca0cdbad00ff358fee6f104.tar.gz cpython-1e93b060077db01ceca0cdbad00ff358fee6f104.tar.bz2 |
complain about "global __class__" in a class body (closes #17983)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_scope.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py index 41678b5..26ce042 100644 --- a/Lib/test/test_scope.py +++ b/Lib/test/test_scope.py @@ -743,6 +743,10 @@ class ScopeTests(unittest.TestCase): del tester self.assertIsNone(ref()) + def test__Class__Global(self): + s = "class X:\n global __class__\n def f(self): super()" + self.assertRaises(SyntaxError, exec, s) + def test_main(): run_unittest(ScopeTests) |