summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Howitz <mh@gocept.com>2021-11-19 17:01:24 +0100
committerMichael Howitz <mh@gocept.com>2021-11-19 17:01:24 +0100
commitbd3cf813b81ded3dba9baf3f9d4fd990136471c4 (patch)
tree4c392360fd138dc48f5e2994966bd6efd054bb64
parent7b494bc6348cde6e03b5b44f026abe8aa7d3a412 (diff)
downloadzope-proxy-bd3cf813b81ded3dba9baf3f9d4fd990136471c4.tar.gz
Python 3.11 foreward compatibilty.
The Python 2.7 variant was dropped there.
-rw-r--r--src/zope/proxy/tests/test_proxy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/zope/proxy/tests/test_proxy.py b/src/zope/proxy/tests/test_proxy.py
index 5d7124c..9d21d3a 100644
--- a/src/zope/proxy/tests/test_proxy.py
+++ b/src/zope/proxy/tests/test_proxy.py
@@ -43,8 +43,9 @@ class PyProxyBaseTestCase(unittest.TestCase):
# Avoid DeprecationWarning for assertRaisesRegexp on Python 3 while
# coping with Python 2 not having the Regex spelling variant
- assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex',
- unittest.TestCase.assertRaisesRegexp)
+ assertRaisesRegex = getattr(
+ unittest.TestCase, 'assertRaisesRegex',
+ getattr(unittest.TestCase, 'assertRaisesRegexp', None))
def _getTargetClass(self):
from zope.proxy import PyProxyBase