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
5c0fb00a
Commit
5c0fb00a
authored
Oct 01, 2011
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
31616ea2
de636f3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
Include/unicodeobject.h
Include/unicodeobject.h
+2
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+6
-3
No files found.
Include/unicodeobject.h
View file @
5c0fb00a
...
...
@@ -795,7 +795,9 @@ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
Py_ssize_t
*
size
/* number of characters of the result */
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
*
)
_PyUnicode_AsKind
(
PyObject
*
s
,
unsigned
int
kind
);
#endif
#endif
...
...
Objects/unicodeobject.c
View file @
5c0fb00a
...
...
@@ -10446,6 +10446,11 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end)
int
kind
;
Py_ssize_t
length
;
if
(
PyUnicode_READY
(
self
)
==
-
1
)
return
NULL
;
end
=
Py_MIN
(
end
,
PyUnicode_GET_LENGTH
(
self
));
if
(
start
==
0
&&
end
==
PyUnicode_GET_LENGTH
(
self
))
{
if
(
PyUnicode_CheckExact
(
self
))
{
...
...
@@ -10460,13 +10465,11 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end)
if
(
length
==
1
)
return
unicode_getitem
((
PyUnicodeObject
*
)
self
,
start
);
if
(
start
<
0
||
end
<
0
||
end
>
PyUnicode_GET_LENGTH
(
self
)
)
{
if
(
start
<
0
||
end
<
0
)
{
PyErr_SetString
(
PyExc_IndexError
,
"string index out of range"
);
return
NULL
;
}
if
(
PyUnicode_READY
(
self
)
==
-
1
)
return
NULL
;
kind
=
PyUnicode_KIND
(
self
);
data
=
PyUnicode_1BYTE_DATA
(
self
);
return
PyUnicode_FromKindAndData
(
kind
,
...
...
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