mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-02-22 03:19:04 +01:00
Fix python unittest deprecation warning
This commit is contained in:
parent
0339cb0e31
commit
00e69b3df6
@ -73,11 +73,11 @@ class ExtServerStdApiTest(unittest.TestCase):
|
|||||||
self.assertIsInstance(result[1], bytes)
|
self.assertIsInstance(result[1], bytes)
|
||||||
|
|
||||||
def assertRegex(self, text, regexp, msg=None):
|
def assertRegex(self, text, regexp, msg=None):
|
||||||
# Python 2.7
|
if hasattr(super(self.__class__.__bases__[0], self), 'assertRegex'):
|
||||||
if self.assertRegexpMatches:
|
super(self.__class__.__bases__[0], self).assertRegex(text, regexp, msg)
|
||||||
self.assertRegexpMatches(text, regexp, msg)
|
|
||||||
else:
|
else:
|
||||||
super().assertRegex(text, regexp, msg)
|
# Python 2.7 fallback
|
||||||
|
self.assertRegexpMatches(text, regexp, msg)
|
||||||
|
|
||||||
|
|
||||||
class ExtServerStdApiNetworkTest(ExtServerStdApiTest):
|
class ExtServerStdApiNetworkTest(ExtServerStdApiTest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user