Skip to content

Commit

Permalink
Fix pickling of _LazyModule
Browse files Browse the repository at this point in the history
Since importing six automatically sets up six.moves, _LazyModule
instances can be unpickled by just importing them.

Fixes benjaminp#194.
  • Loading branch information
Daniel Li committed May 2, 2017
1 parent 3280aa8 commit 63ae6d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions six.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def __dir__(self):
# Subclasses should override this
_moved_attributes = []

def __reduce__(self):
return _import_module, (self.__name__,)


class MovedAttribute(_LazyDescr):

Expand Down

0 comments on commit 63ae6d6

Please sign in to comment.