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
24f56e14
Commit
24f56e14
authored
Mar 02, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MSVC fixes.
parent
0d651b18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+11
-8
No files found.
Cython/Utility/TypeConversion.c
View file @
24f56e14
...
...
@@ -136,18 +136,21 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
PyUnicode_Check
(
o
))
{
#if PY_VERSION_HEX < 0x03030000
char
*
defenc_c
;
// borrowed, cached reference
PyObject
*
defenc
=
_PyUnicode_AsDefaultEncodedString
(
o
,
NULL
);
if
(
!
defenc
)
return
NULL
;
char
*
defenc_c
=
PyBytes_AS_STRING
(
defenc
);
defenc_c
=
PyBytes_AS_STRING
(
defenc
);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
char
*
end
=
defenc_c
+
PyBytes_GET_SIZE
(
defenc
);
char
*
c
;
for
(
c
=
defenc_c
;
c
<
end
;
c
++
)
{
if
((
unsigned
char
)
(
*
c
)
>=
128
)
{
// raise the error
PyUnicode_AsASCIIString
(
o
);
return
NULL
;
{
char
*
end
=
defenc_c
+
PyBytes_GET_SIZE
(
defenc
);
char
*
c
;
for
(
c
=
defenc_c
;
c
<
end
;
c
++
)
{
if
((
unsigned
char
)
(
*
c
)
>=
128
)
{
// raise the error
PyUnicode_AsASCIIString
(
o
);
return
NULL
;
}
}
}
#endif
/*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
...
...
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