aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/support')
-rw-r--r--Lib/test/support/__init__.py1
-rw-r--r--Lib/test/support/channels.py8
2 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 51c0ce11e82..fd39d3f7c95 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2333,6 +2333,7 @@ def check_disallow_instantiation(testcase, tp, *args, **kwds):
qualname = f"{name}"
msg = f"cannot create '{re.escape(qualname)}' instances"
testcase.assertRaisesRegex(TypeError, msg, tp, *args, **kwds)
+ testcase.assertRaisesRegex(TypeError, msg, tp.__new__, tp, *args, **kwds)
def get_recursion_depth():
"""Get the recursion depth of the caller function.
diff --git a/Lib/test/support/channels.py b/Lib/test/support/channels.py
index b2de24d9d3e..fab1797659b 100644
--- a/Lib/test/support/channels.py
+++ b/Lib/test/support/channels.py
@@ -105,12 +105,8 @@ class _ChannelEnd:
return other._id == self._id
# for pickling:
- def __getnewargs__(self):
- return (int(self._id),)
-
- # for pickling:
- def __getstate__(self):
- return None
+ def __reduce__(self):
+ return (type(self), (int(self._id),))
@property
def id(self):