summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2007-04-23 10:14:27 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2007-04-23 10:14:27 (GMT)
commit4138bfec0a189d180b7bcb89e7c8ce8a456a6b55 (patch)
treebb2b24ec1eece601a1ede4e1c09bd9e8b233c18a /Lib
parent846f1ee39004e7e00f8982928ccc166e01436a77 (diff)
downloadcpython-4138bfec0a189d180b7bcb89e7c8ce8a456a6b55.zip
cpython-4138bfec0a189d180b7bcb89e7c8ce8a456a6b55.tar.gz
cpython-4138bfec0a189d180b7bcb89e7c8ce8a456a6b55.tar.bz2
Don't crash when nonlocal is used at module level (fixes SF#1705365)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_syntax.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index b21f6cf..b5a5c5d 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -388,6 +388,12 @@ Misuse of the nonlocal statement can lead to a few unique syntax errors.
...
SyntaxError: no binding for nonlocal 'x' found
+From SF bug #1705365
+ >>> nonlocal x
+ Traceback (most recent call last):
+ ...
+ SyntaxError: nonlocal declaration not allowed at module level
+
TODO(jhylton): Figure out how to test SyntaxWarning with doctest.
## >>> def f(x):