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
0567421a
Commit
0567421a
authored
Apr 11, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The _struct module caches things internally
parent
c483a729
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
3 deletions
+4
-3
from_cpython/Modules/_struct.c
from_cpython/Modules/_struct.c
+4
-0
test/tests/gzip_test.py
test/tests/gzip_test.py
+0
-1
test/tests/json_test.py
test/tests/json_test.py
+0
-1
test/tests/struct_test.py
test/tests/struct_test.py
+0
-1
No files found.
from_cpython/Modules/_struct.c
View file @
0567421a
...
@@ -1819,6 +1819,7 @@ cache_struct(PyObject *fmt)
...
@@ -1819,6 +1819,7 @@ cache_struct(PyObject *fmt)
cache
=
PyDict_New
();
cache
=
PyDict_New
();
if
(
cache
==
NULL
)
if
(
cache
==
NULL
)
return
NULL
;
return
NULL
;
PyGC_RegisterStaticConstant
(
cache
);
}
}
s_object
=
PyDict_GetItem
(
cache
,
fmt
);
s_object
=
PyDict_GetItem
(
cache
,
fmt
);
...
@@ -1844,6 +1845,9 @@ PyDoc_STRVAR(clearcache_doc,
...
@@ -1844,6 +1845,9 @@ PyDoc_STRVAR(clearcache_doc,
static
PyObject
*
static
PyObject
*
clearcache
(
PyObject
*
self
)
clearcache
(
PyObject
*
self
)
{
{
// `cache` is already registered as a static root; we would need to unregister it.
Py_FatalError
(
"_struct.clearcache dosen't currently work well with Pyston"
);
abort
();
Py_CLEAR
(
cache
);
Py_CLEAR
(
cache
);
Py_RETURN_NONE
;
Py_RETURN_NONE
;
}
}
...
...
test/tests/gzip_test.py
View file @
0567421a
# expected: reffail
import
gzip
import
gzip
import
io
import
io
...
...
test/tests/json_test.py
View file @
0567421a
# expected: reffail
from
StringIO
import
StringIO
from
StringIO
import
StringIO
import
json
import
json
...
...
test/tests/struct_test.py
View file @
0567421a
# expected: reffail
import
struct
import
struct
s
=
struct
.
pack
(
"II"
,
1
,
1234
)
s
=
struct
.
pack
(
"II"
,
1
,
1234
)
print
repr
(
s
)
print
repr
(
s
)
...
...
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