bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22747)
(cherry picked from commit c304c9a7efa8751b5bc7526fa95cd5f30aac2b92)
Co-authored-by: scaramallion <scaramallion@users.noreply.github.com>
diff --git a/Lib/datetime.py b/Lib/datetime.py
index 2294ac2..e508d99 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -1579,7 +1579,7 @@
self._tzinfo = tzinfo
def __reduce_ex__(self, protocol):
- return (time, self._getstate(protocol))
+ return (self.__class__, self._getstate(protocol))
def __reduce__(self):
return self.__reduce_ex__(2)