From 63ae6d6f6876687e84b8ec075437620ff2864d76 Mon Sep 17 00:00:00 2001 From: Daniel Li Date: Tue, 2 May 2017 17:02:58 -0400 Subject: [PATCH] Fix pickling of _LazyModule Since importing six automatically sets up six.moves, _LazyModule instances can be unpickled by just importing them. Fixes #194. --- six.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/six.py b/six.py index 529332582..19a75b061 100644 --- a/six.py +++ b/six.py @@ -135,6 +135,9 @@ def __dir__(self): # Subclasses should override this _moved_attributes = [] + def __reduce__(self): + return _import_module, (self.__name__,) + class MovedAttribute(_LazyDescr):