aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/concurrent/interpreters
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/concurrent/interpreters')
-rw-r--r--Lib/concurrent/interpreters/__init__.py8
-rw-r--r--Lib/concurrent/interpreters/_queues.py8
2 files changed, 4 insertions, 12 deletions
diff --git a/Lib/concurrent/interpreters/__init__.py b/Lib/concurrent/interpreters/__init__.py
index 0fd661249a2..aa46a2b37a4 100644
--- a/Lib/concurrent/interpreters/__init__.py
+++ b/Lib/concurrent/interpreters/__init__.py
@@ -146,12 +146,8 @@ class Interpreter:
self._decref()
# for pickling:
- def __getnewargs__(self):
- return (self._id,)
-
- # for pickling:
- def __getstate__(self):
- return None
+ def __reduce__(self):
+ return (type(self), (self._id,))
def _decref(self):
if not self._ownsref:
diff --git a/Lib/concurrent/interpreters/_queues.py b/Lib/concurrent/interpreters/_queues.py
index 99987f2f692..9c12b2c8c24 100644
--- a/Lib/concurrent/interpreters/_queues.py
+++ b/Lib/concurrent/interpreters/_queues.py
@@ -129,12 +129,8 @@ class Queue:
return hash(self._id)
# for pickling:
- def __getnewargs__(self):
- return (self._id,)
-
- # for pickling:
- def __getstate__(self):
- return None
+ def __reduce__(self):
+ return (type(self), (self._id,))
def _set_unbound(self, op, items=None):
assert not hasattr(self, '_unbound')