Skip to content

Commit

Permalink
Fix cache on PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Nov 25, 2016
1 parent 020f477 commit e0c1130
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloudpickle/cloudpickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ def save_function_tuple(self, func):
write(pickle.TUPLE)
write(pickle.REDUCE) # applies _fill_function on the tuple


_extract_code_globals_cache = (weakref.WeakKeyDictionary()
if sys.version_info >= (2, 7)
else {})
_extract_code_globals_cache = (
weakref.WeakKeyDictionary()
if sys.version_info >= (2, 7) and not hasattr(sys, "sys.pypy_version_info")
else {})

@classmethod
def extract_code_globals(cls, co):
Expand Down

0 comments on commit e0c1130

Please sign in to comment.