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
114fe16b
Commit
114fe16b
authored
Jul 06, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't generate pickling for types that already have a __getstate__ method.
parent
b0a99d41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-0
Cython/Utility/ExtensionTypes.c
Cython/Utility/ExtensionTypes.c
+2
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
114fe16b
...
...
@@ -1622,6 +1622,8 @@ if VALUE is not None:
checksum
=
'0x%s'
%
hashlib
.
md5
(
' '
.
join
(
all_members_names
).
encode
(
'utf-8'
)).
hexdigest
()[:
7
]
unpickle_func_name
=
'__pyx_unpickle_%s'
%
node
.
class_name
# TODO(robertwb): Move the state into the third argument
# so it can be pickled *after* self is memoized.
unpickle_func
=
TreeFragment
(
u"""
def %(unpickle_func_name)s(__pyx_type, long __pyx_checksum, __pyx_state, %(args)s):
if __pyx_checksum != %(checksum)s:
...
...
Cython/Utility/ExtensionTypes.c
View file @
114fe16b
...
...
@@ -69,6 +69,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) {
PyObject
*
reduce_ex
=
NULL
;
PyObject
*
reduce_cython
=
NULL
;
if
(
PyObject_HasAttrString
(
type_obj
,
"__getstate__"
))
goto
GOOD
;
if
(
object_reduce_ex
==
NULL
)
{
__Pyx_setup_reduce_GET_ATTR_OR_BAD
(
builtin_object
,
__pyx_b
,
"object"
);
__Pyx_setup_reduce_GET_ATTR_OR_BAD
(
object_reduce
,
builtin_object
,
"__reduce__"
);
...
...
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