Fix python unittest deprecation warning

This commit is contained in:
adfoster-r7 2023-09-19 23:10:38 +01:00
parent 0339cb0e31
commit 00e69b3df6
1 changed files with 4 additions and 4 deletions

View File

@ -73,11 +73,11 @@ class ExtServerStdApiTest(unittest.TestCase):
self.assertIsInstance(result[1], bytes)
def assertRegex(self, text, regexp, msg=None):
# Python 2.7
if self.assertRegexpMatches:
self.assertRegexpMatches(text, regexp, msg)
if hasattr(super(self.__class__.__bases__[0], self), 'assertRegex'):
super(self.__class__.__bases__[0], self).assertRegex(text, regexp, msg)
else:
super().assertRegex(text, regexp, msg)
# Python 2.7 fallback
self.assertRegexpMatches(text, regexp, msg)
class ExtServerStdApiNetworkTest(ExtServerStdApiTest):