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
457bd713
Commit
457bd713
authored
Aug 23, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix unicode integer indexing for PEP 393
parent
9f49a988
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+4
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
457bd713
...
...
@@ -2442,7 +2442,7 @@ class IndexNode(ExprNode):
elif
self
.
base
.
type
is
tuple_type
:
return
"PyTuple_GET_ITEM(%s, %s)"
%
(
self
.
base
.
result
(),
self
.
index
.
result
())
elif
self
.
base
.
type
is
unicode_type
and
self
.
type
.
is_unicode_char
:
return
"
PyUnicode_AS_UNICODE(%s)[%s]
"
%
(
self
.
base
.
result
(),
self
.
index
.
result
())
return
"
__Pyx_PyUnicode_READ_CHAR(%s, %s)
"
%
(
self
.
base
.
result
(),
self
.
index
.
result
())
elif
(
self
.
type
.
is_ptr
or
self
.
type
.
is_array
)
and
self
.
type
==
self
.
base
.
type
:
error
(
self
.
pos
,
"Invalid use of pointer slice"
)
else
:
...
...
Cython/Compiler/ModuleNode.py
View file @
457bd713
...
...
@@ -581,9 +581,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
/* new Py3.3 unicode representation (PEP 393) */
#ifdef PyUnicode_GET_LENGTH
#define CYTHON_PEP393_ENABLED
#define __Pyx_PyUnicode_GET_LENGTH PyUnicode_GET_LENGTH
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
#define __Pyx_PyUnicode_GET_LENGTH PyUnicode_GET_SIZE
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) (PyUnicode_AS_UNICODE(u)[i])
#endif
#if PY_MAJOR_VERSION >= 3
...
...
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