Skip to content

Commit 1ae5943

Browse files
authored
FIX: backward compat for types.ClassType attribute (#359)
* FIX: backward compat for types.ClassType attribute * typo * Add entry to changelog
1 parent 162af78 commit 1ae5943

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
1.4.1 (in development)
22
======================
33

4+
- Restore compat with loading dynamic classes pickled with cloudpickle
5+
version 1.2.1 that would reference the `types.ClassType` attribute.
6+
([PR #359](https://github.com/cloudpipe/cloudpickle/pull/359))
47

58

69
1.4.0

Diff for: cloudpickle/cloudpickle.py

+5
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,11 @@ def _cell_set_factory(value):
388388

389389

390390
def _builtin_type(name):
391+
if name == "ClassType": # pragma: no cover
392+
# Backward compat to load pickle files generated with cloudpickle
393+
# < 1.3 even if loading pickle files from older versions is not
394+
# officially supported.
395+
return type
391396
return getattr(types, name)
392397

393398

0 commit comments

Comments
 (0)