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
6fea7f7f
Commit
6fea7f7f
authored
Aug 22, 2016
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #27809: Cleanup _PyEval_EvalCodeWithName()
* Rename nm to name * PEP 7: add { ... } to if/else blocks
parent
b9009391
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
Python/ceval.c
Python/ceval.c
+13
-15
No files found.
Python/ceval.c
View file @
6fea7f7f
...
...
@@ -3878,28 +3878,28 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
normally interned this should almost always hit. */
co_varnames
=
((
PyTupleObject
*
)(
co
->
co_varnames
))
->
ob_item
;
for
(
j
=
0
;
j
<
total_args
;
j
++
)
{
PyObject
*
n
m
=
co_varnames
[
j
];
if
(
n
m
==
keyword
)
PyObject
*
n
ame
=
co_varnames
[
j
];
if
(
n
ame
==
keyword
)
{
goto
kw_found
;
}
}
/* Slow fallback, just in case */
for
(
j
=
0
;
j
<
total_args
;
j
++
)
{
PyObject
*
nm
=
co_varnames
[
j
];
int
cmp
=
PyObject_RichCompareBool
(
keyword
,
nm
,
Py_EQ
);
if
(
cmp
>
0
)
PyObject
*
name
=
co_varnames
[
j
];
int
cmp
=
PyObject_RichCompareBool
(
keyword
,
name
,
Py_EQ
);
if
(
cmp
>
0
)
{
goto
kw_found
;
else
if
(
cmp
<
0
)
}
else
if
(
cmp
<
0
)
{
goto
fail
;
}
}
if
(
j
>=
total_args
&&
kwdict
==
NULL
)
{
PyErr_Format
(
PyExc_TypeError
,
"%U() got an unexpected "
"keyword argument '%S'"
,
co
->
co_name
,
keyword
);
"%U() got an unexpected keyword argument '%S'"
,
co
->
co_name
,
keyword
);
goto
fail
;
}
...
...
@@ -3911,10 +3911,8 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
kw_found:
if
(
GETLOCAL
(
j
)
!=
NULL
)
{
PyErr_Format
(
PyExc_TypeError
,
"%U() got multiple "
"values for argument '%S'"
,
co
->
co_name
,
keyword
);
"%U() got multiple values for argument '%S'"
,
co
->
co_name
,
keyword
);
goto
fail
;
}
Py_INCREF
(
value
);
...
...
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