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
dd7eb146
Commit
dd7eb146
authored
Oct 18, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #792869: Clarify error message for parameters declared global,
rename LOCAL_GLOBAL to PARAM_GLOBAL.
parent
0f0c06a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
Python/compile.c
Python/compile.c
+3
-4
No files found.
Python/compile.c
View file @
dd7eb146
...
@@ -60,7 +60,7 @@ int Py_OptimizeFlag = 0;
...
@@ -60,7 +60,7 @@ int Py_OptimizeFlag = 0;
#define GLOBAL_AFTER_USE \
#define GLOBAL_AFTER_USE \
"name '%.400s' is used prior to global declaration"
"name '%.400s' is used prior to global declaration"
#define
LOCAL
_GLOBAL \
#define
PARAM
_GLOBAL \
"name '%.400s' is a function parameter and declared global"
"name '%.400s' is a function parameter and declared global"
#define LATE_FUTURE \
#define LATE_FUTURE \
...
@@ -4843,7 +4843,7 @@ symtable_load_symbols(struct compiling *c)
...
@@ -4843,7 +4843,7 @@ symtable_load_symbols(struct compiling *c)
c
->
c_argcount
--
;
c
->
c_argcount
--
;
else
if
(
flags
&
DEF_GLOBAL
)
{
else
if
(
flags
&
DEF_GLOBAL
)
{
if
(
flags
&
DEF_PARAM
)
{
if
(
flags
&
DEF_PARAM
)
{
PyErr_Format
(
PyExc_SyntaxError
,
LOCAL
_GLOBAL
,
PyErr_Format
(
PyExc_SyntaxError
,
PARAM
_GLOBAL
,
PyString_AS_STRING
(
name
));
PyString_AS_STRING
(
name
));
symtable_error
(
st
,
0
);
symtable_error
(
st
,
0
);
goto
fail
;
goto
fail
;
...
@@ -5592,8 +5592,7 @@ symtable_global(struct symtable *st, node *n)
...
@@ -5592,8 +5592,7 @@ symtable_global(struct symtable *st, node *n)
if
(
flags
&&
flags
!=
DEF_GLOBAL
)
{
if
(
flags
&&
flags
!=
DEF_GLOBAL
)
{
char
buf
[
500
];
char
buf
[
500
];
if
(
flags
&
DEF_PARAM
)
{
if
(
flags
&
DEF_PARAM
)
{
PyErr_Format
(
PyExc_SyntaxError
,
PyErr_Format
(
PyExc_SyntaxError
,
PARAM_GLOBAL
,
"name '%.400s' is local and global"
,
name
);
name
);
symtable_error
(
st
,
0
);
symtable_error
(
st
,
0
);
return
;
return
;
...
...
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