Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
88d63f36
Commit
88d63f36
authored
Feb 25, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '34ab5e' into refcounting
parents
ddb51c9b
34ab5edb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
4 deletions
+22
-4
from_cpython/Lib/test/test_string.py
from_cpython/Lib/test/test_string.py
+0
-3
from_cpython/Objects/stringobject.c
from_cpython/Objects/stringobject.c
+16
-0
src/runtime/str.cpp
src/runtime/str.cpp
+4
-0
src/runtime/types.cpp
src/runtime/types.cpp
+2
-0
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+0
-1
No files found.
from_cpython/Lib/test/test_string.py
View file @
88d63f36
# skip-if: True
# expected: fail
# this test gets stuck in an infinite loop(?) in test_replace (from string_tests)
import
unittest
,
string
from
test
import
test_support
,
string_tests
from
UserList
import
UserList
...
...
from_cpython/Objects/stringobject.c
View file @
88d63f36
...
...
@@ -23,6 +23,22 @@ PyObject * _do_string_format(PyObject *self, PyObject *args, PyObject *kwargs) {
return
do_string_format
(
self
,
args
,
kwargs
);
}
void
_string_init
()
{
if
(
PyType_Ready
(
&
PyFieldNameIter_Type
)
<
0
)
Py_FatalError
(
"Can't initialize field name iterator type"
);
if
(
PyType_Ready
(
&
PyFormatterIter_Type
)
<
0
)
Py_FatalError
(
"Can't initialize formatter iter type"
);
}
PyObject
*
_formatter_parser
(
STRINGLIB_OBJECT
*
self
)
{
return
formatter_parser
(
self
);
}
PyObject
*
_formatter_field_name_split
(
STRINGLIB_OBJECT
*
self
)
{
return
formatter_field_name_split
(
self
);
}
PyObject
*
string_count
(
PyStringObject
*
self
,
PyObject
*
sub_obj
,
PyObject
*
obj_start
,
PyObject
**
args
)
...
...
src/runtime/str.cpp
View file @
88d63f36
...
...
@@ -45,6 +45,8 @@ extern "C" PyObject* string_rfind(PyStringObject* self, PyObject* args) noexcept
extern
"C"
PyObject
*
string_replace
(
PyStringObject
*
self
,
PyObject
*
args
)
noexcept
;
extern
"C"
PyObject
*
string_splitlines
(
PyStringObject
*
self
,
PyObject
*
args
)
noexcept
;
extern
"C"
PyObject
*
string__format__
(
PyObject
*
self
,
PyObject
*
args
)
noexcept
;
extern
"C"
PyObject
*
_formatter_parser
(
PyStringObject
*
self
)
noexcept
;
extern
"C"
PyObject
*
_formatter_field_name_split
(
PyStringObject
*
self
)
noexcept
;
// from cpython's stringobject.c:
#define LEFTSTRIP 0
...
...
@@ -2806,6 +2808,8 @@ static PyMethodDef string_methods[] = {
{
"splitlines"
,
(
PyCFunction
)
string_splitlines
,
METH_VARARGS
,
NULL
},
{
"zfill"
,
(
PyCFunction
)
string_zfill
,
METH_VARARGS
,
NULL
},
{
"__format__"
,
(
PyCFunction
)
string__format__
,
METH_VARARGS
,
NULL
},
{
"_formatter_parser"
,
(
PyCFunction
)
_formatter_parser
,
METH_NOARGS
,
NULL
},
{
"_formatter_field_name_split"
,
(
PyCFunction
)
_formatter_field_name_split
,
METH_NOARGS
,
NULL
},
};
void
setupStr
()
{
...
...
src/runtime/types.cpp
View file @
88d63f36
...
...
@@ -78,6 +78,7 @@ extern "C" void initzlib();
extern
"C"
void
init_codecs
();
extern
"C"
void
init_socket
();
extern
"C"
void
_PyUnicode_Init
();
extern
"C"
void
_string_init
();
extern
"C"
void
initunicodedata
();
extern
"C"
void
init_weakref
();
extern
"C"
void
initcStringIO
();
...
...
@@ -4067,6 +4068,7 @@ void setupRuntime() {
_PyUnicode_Init
();
unicode_cls
->
is_constant
=
true
;
unicode_cls
->
is_user_defined
=
false
;
_string_init
();
setupDescr
();
setupTraceback
();
setupCode
();
...
...
test/CPYTHON_TEST_NOTES.md
View file @
88d63f36
...
...
@@ -200,7 +200,6 @@ test_sort argument specification issue in listSort?
test_sqlite [unknown]
test_ssl [unknown]
test_startfile [unknown]
test_string infinite loops in test_replace
test_str memory leak?
test_strtod [unknown]
test_structmembers [unknown]
...
...
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