1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-02-16 00:24:29 +01:00

Land #674, Fix python unittest deprecation warning

This commit is contained in:
Simon Janusz 2023-09-20 11:06:05 +01:00 committed by GitHub
commit 0d2ad16e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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):