Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
047e2c93
Commit
047e2c93
authored
Jan 19, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for SyntaxError on
def f(a): global a
parent
c862cf40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Lib/test/test_compile.py
Lib/test/test_compile.py
+7
-1
No files found.
Lib/test/test_compile.py
View file @
047e2c93
from
test_support
import
verbose
,
TestFailed
if
verbose
:
print
'Running test
on duplicate arguments
'
print
'Running test
s on argument handling
'
try
:
exec
(
'def f(a, a): pass'
)
...
...
@@ -14,3 +14,9 @@ try:
raise
TestFailed
,
"duplicate keyword arguments"
except
SyntaxError
:
pass
try
:
exec
(
'def f(a): global a; a = 1'
)
raise
TestFailed
,
"variable is global and local"
except
SyntaxError
:
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment