-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull threading.local out of the generated repr's globals.
Generated `__repr__` methods for Pythons with f-strings included a `threading.local` object in that method's `globals()` dictionary. Because `cloudpickle` attempts to serialize all globals of this method, it ends up trying to pickle the `threading.local`, which cannot be pickled. Instead, we now pull use of the thread-local out into its own function, which `cloudpickle` will happily serialize. As an added benefit, this eliminates some duplicated code between f-string and non–f-string `__repr__`s. Should fix: - #458 - cloudpipe/cloudpickle#320
- Loading branch information
1 parent
f812ec5
commit 2063781
Showing
2 changed files
with
58 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixes ``cloudpickle`` compatibility issue, allowing attrs classes to be safely pickled using CloudPickle. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters