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:
commit
0d2ad16e32
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user