diff --git a/CHANGES.md b/CHANGES.md index 0ca5a92b4..577567111 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,9 +4,6 @@ - Fix a bug affecting dynamic modules occuring with modified builtins ([issue #316](https://github.com/cloudpipe/cloudpickle/issues/316)) -1.2.3 -===== - - Fix a bug affecting cloudpickle when non-modules objects are added into sys.modules ([PR #326](https://github.com/cloudpipe/cloudpickle/pull/326)). @@ -23,6 +20,10 @@ https://docs.python.org/3/library/pickle.html#example ([issue #308](https://github.com/cloudpipe/cloudpickle/pull/308)) +- Fix a side effect that would redefine `types.ClassTypes` as `type` + when importing cloudpickle. + ([issue #337](https://github.com/cloudpipe/cloudpickle/pull/337)) + 1.2.2 ===== diff --git a/cloudpickle/__init__.py b/cloudpickle/__init__.py index 0369eec03..f0c49bbb2 100644 --- a/cloudpickle/__init__.py +++ b/cloudpickle/__init__.py @@ -8,4 +8,4 @@ if sys.version_info[:2] >= (3, 8): from cloudpickle.cloudpickle_fast import CloudPickler, dumps, dump -__version__ = '1.2.3dev0' +__version__ = '1.3.0dev0' diff --git a/cloudpickle/cloudpickle.py b/cloudpickle/cloudpickle.py index 638ec28ee..c48572323 100644 --- a/cloudpickle/cloudpickle.py +++ b/cloudpickle/cloudpickle.py @@ -95,7 +95,6 @@ PY3 = False PY2 = True else: - types.ClassType = type from pickle import _Pickler as Pickler from io import BytesIO as StringIO string_types = (str,) @@ -889,7 +888,8 @@ def save_global(self, obj, name=None, pack=struct.pack): Pickler.save_global(self, obj, name=name) dispatch[type] = save_global - dispatch[types.ClassType] = save_global + if PY2: + dispatch[types.ClassType] = save_global def save_instancemethod(self, obj): # Memoization rarely is ever useful due to python bounding