From 2ec0f507f0218663a6335b0588027c854c691abc Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Fri, 6 May 2022 10:25:50 -0400 Subject: [PATCH] compat: Import Pickler from "pickle" instead of "_pickle" The latter is an implementation detail (see [0]), and the docs instruct users to "always import the standard version"[0]. Moreover, "pickle.Pickler" is the same as "_pickle.Pickler", for all recent CPython releases (tested 3.6->3.9). [0] https://docs.python.org/3.1/whatsnew/3.0.html#library-changes Fixes: https://github.com/cloudpipe/cloudpickle/issues/458 Signed-off-by: Jan Vesely --- cloudpickle/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudpickle/compat.py b/cloudpickle/compat.py index afa285f62..b37e3da1a 100644 --- a/cloudpickle/compat.py +++ b/cloudpickle/compat.py @@ -10,4 +10,4 @@ from pickle import _Pickler as Pickler # noqa: F401 else: import pickle # noqa: F401 - from _pickle import Pickler # noqa: F401 + from pickle import Pickler # noqa: F401