summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2021-01-13 12:01:38 +0100
committerMatěj Cepl <mcepl@cepl.eu>2021-01-14 14:29:59 +0100
commite902dbd9ad1a045c29f295c0099e42f5ff7e91d8 (patch)
tree13deb1fc34d9ce48b558a5f2568b2dc59b2969ca
parent9178c4d56b7270a6b813995f55a4828ce96256d8 (diff)
downloadm2crypto-e902dbd9ad1a045c29f295c0099e42f5ff7e91d8.tar.gz
Remove deprecation warnings
-rw-r--r--src/M2Crypto/SSL/Checker.py6
-rw-r--r--tests/test_obj.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/M2Crypto/SSL/Checker.py b/src/M2Crypto/SSL/Checker.py
index 46d397a..a58186e 100644
--- a/src/M2Crypto/SSL/Checker.py
+++ b/src/M2Crypto/SSL/Checker.py
@@ -63,7 +63,7 @@ class WrongHost(SSLVerificationError):
class Checker(object):
- numericIpMatch = re.compile('^[0-9]+(\.[0-9]+)*$')
+ numericIpMatch = re.compile(r'^[0-9]+(\.[0-9]+)*$')
def __init__(self, host=None, peerCertHash=None, peerCertDigest='sha1'):
# type: (Optional[str], Optional[bytes], str) -> None
@@ -253,8 +253,8 @@ class Checker(object):
return False
# Massage certHost so that it can be used in regex
- certHost = certHost.replace('.', '\.')
- certHost = certHost.replace('*', '[^\.]*')
+ certHost = certHost.replace('.', '\\.')
+ certHost = certHost.replace('*', '[^\\.]*')
if re.compile('^%s$' % certHost).match(host):
return True
diff --git a/tests/test_obj.py b/tests/test_obj.py
index 55854c3..5f3fe92 100644
--- a/tests/test_obj.py
+++ b/tests/test_obj.py
@@ -124,7 +124,7 @@ class ObjectsTestCase(unittest.TestCase):
try:
s.verify(p7, data)
except SMIME.PKCS7_Error as e:
- self.assertRegexpMatches(str(e),
+ six.assertRegex(self, str(e),
"unable to get local issuer certificate",
"Not received expected error message")