Commit 35fbd289 authored by Robert Bradshaw's avatar Robert Bradshaw

Exclude special __dict__ and __weakref__ attributes from pickling.

parent 2002ddfb
...@@ -1573,10 +1573,10 @@ if VALUE is not None: ...@@ -1573,10 +1573,10 @@ if VALUE is not None:
cls = node.entry.type cls = node.entry.type
cinit = None cinit = None
while cls is not 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__') cinit = cinit or cls.scope.lookup('__cinit__')
cls = cls.base_type cls = cls.base_type
all_members.sort(key=lambda e: e.name) all_members.sort(key=lambda e: e.name)
non_py = [ non_py = [
e for e in all_members e for e in all_members
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment