diff Lib/test/test_syntax.py @ 41508:55d761acdcbc

Don't crash when nonlocal is used at module level (fixes SF#1705365)
author Nick Coghlan <ncoghlan@gmail.com>
date Mon, 23 Apr 2007 10:14:27 +0000
parents 060c79f6d919
children 06145fbc7ab9
line wrap: on
line diff
--- a/Lib/test/test_syntax.py	Sat Apr 21 20:17:46 2007 +0000
+++ b/Lib/test/test_syntax.py	Mon Apr 23 10:14:27 2007 +0000
@@ -388,6 +388,12 @@
      ...
    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):