Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
3588f89c
Commit
3588f89c
authored
May 15, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for keyword arg checking
parent
b4864b08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-0
No files found.
Cython/Compiler/Nodes.py
View file @
3588f89c
...
@@ -4000,7 +4000,11 @@ static int __Pyx_CheckKeywordStrings(
...
@@ -4000,7 +4000,11 @@ static int __Pyx_CheckKeywordStrings(
PyObject* key = 0;
PyObject* key = 0;
Py_ssize_t pos = 0;
Py_ssize_t pos = 0;
while (PyDict_Next(kwdict, &pos, &key, 0)) {
while (PyDict_Next(kwdict, &pos, &key, 0)) {
#if PY_MAJOR_VERSION < 3
if (unlikely(!PyString_Check(key))) {
if (unlikely(!PyString_Check(key))) {
#else
if (unlikely(!PyUnicode_Check(key))) {
#endif
PyErr_Format(PyExc_TypeError,
PyErr_Format(PyExc_TypeError,
"%s() keywords must be strings", function_name);
"%s() keywords must be strings", function_name);
return 0;
return 0;
...
@@ -4009,7 +4013,11 @@ static int __Pyx_CheckKeywordStrings(
...
@@ -4009,7 +4013,11 @@ static int __Pyx_CheckKeywordStrings(
if (unlikely(!kw_allowed) && unlikely(key)) {
if (unlikely(!kw_allowed) && unlikely(key)) {
PyErr_Format(PyExc_TypeError,
PyErr_Format(PyExc_TypeError,
"'%s' is an invalid keyword argument for this function",
"'%s' is an invalid keyword argument for this function",
#if PY_MAJOR_VERSION < 3
PyString_AsString(key));
PyString_AsString(key));
#else
PyUnicode_AsString(key));
#endif
return 0;
return 0;
}
}
return 1;
return 1;
...
...
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