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
01451895
Commit
01451895
authored
Apr 17, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert Py2 str to unicode directly when building fused function signature.
parent
56c382f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+6
-6
No files found.
Cython/Utility/CythonFunction.c
View file @
01451895
...
...
@@ -1133,18 +1133,18 @@ __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
}
static
PyObject
*
_obj_to_str
(
PyObject
*
obj
)
_obj_to_str
ing
(
PyObject
*
obj
)
{
if
(
PyUnicode_CheckExact
(
obj
))
return
__Pyx_NewRef
(
obj
);
#if PY_MAJOR_VERSION == 2
else
if
(
PyString_Check
Exact
(
obj
))
return
__Pyx_NewRef
(
obj
);
else
if
(
PyString_Check
(
obj
))
return
PyUnicode_FromEncodedObject
(
obj
,
NULL
,
"strict"
);
#endif
else
if
(
PyType_Check
(
obj
))
return
PyObject_GetAttr
(
obj
,
PYIDENT
(
"__name__"
));
else
return
PyObject_
Str
(
obj
);
return
PyObject_
Unicode
(
obj
);
}
static
PyObject
*
...
...
@@ -1174,7 +1174,7 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
#else
PyObject
*
item
=
PySequence_ITEM
(
idx
,
i
);
if
(
unlikely
(
!
item
))
goto
__pyx_err
;
#endif
string
=
_obj_to_str
(
item
);
string
=
_obj_to_str
ing
(
item
);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
Py_DECREF
(
item
);
#endif
...
...
@@ -1186,7 +1186,7 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
__pyx_err:
;
Py_DECREF
(
list
);
}
else
{
signature
=
_obj_to_str
(
idx
);
signature
=
_obj_to_str
ing
(
idx
);
}
if
(
unlikely
(
!
signature
))
...
...
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