summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ParseTreeTransforms.py
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2017-05-15 22:54:29 -0700
committerRobert Bradshaw <robertwb@gmail.com>2017-05-15 22:54:29 -0700
commit35fbd28985a540f748f733dd478c75a9ca25e59c (patch)
tree79e5074bec42655ea7935a55cd19bfd72002d70e /Cython/Compiler/ParseTreeTransforms.py
parent2002ddfb4a9056c531d4b2fbda654d97bd2e92cf (diff)
downloadcython-35fbd28985a540f748f733dd478c75a9ca25e59c.tar.gz
Exclude special __dict__ and __weakref__ attributes from pickling.
Diffstat (limited to 'Cython/Compiler/ParseTreeTransforms.py')
-rw-r--r--Cython/Compiler/ParseTreeTransforms.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index ed4d92f9f..bb9b2a2dd 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -1573,10 +1573,10 @@ if VALUE is not None:
cls = node.entry.type
cinit = None
while cls is not None:
- all_members.extend(cls.scope.var_entries)
+ all_members.extend(e for e in cls.scope.var_entries if e.name not in ('__weakref__', '__dict__'))
cinit = cinit or cls.scope.lookup('__cinit__')
cls = cls.base_type
- all_members.sort(key=lambda e: e.name)
+ all_members.sort(key=lambda e: e.name)
non_py = [
e for e in all_members