Merge pull request #1641 from PyCQA/entry-points-not-pickleable

work around un-pickleabiliy of EntryPoint in 3.8.0
This commit is contained in:
Anthony Sottile 2022-08-01 08:48:19 -04:00 committed by GitHub
commit 446b18d35a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,4 +6,11 @@ if sys.version_info >= (3, 8): # pragma: no cover (PY38+)
else: # pragma: no cover (<PY38)
import importlib_metadata
if sys.version_info[:3] == (3, 8, 0):
# backported from importlib.metadata in 3.8.1
importlib_metadata.EntryPoint.__reduce__ = lambda self: ( # type: ignore
type(self),
(self.name, self.value, self.group), # type: ignore
)
__all__ = ("importlib_metadata",)