Commit 493e7e26 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

py2/py3: stop using apply().

parent 126ae257
......@@ -116,7 +116,7 @@ class URLOpener(FancyURLopener):
if auth: h.putheader('Authorization', 'Basic %s' % auth)
if realhost: h.putheader('Host', realhost)
for args in self.addheaders: apply(h.putheader, args)
for args in self.addheaders: h.putheader(*args)
h.endheaders()
if data is not None:
h.send(data + '\r\n')
......
......@@ -75,18 +75,20 @@ class Python3StyleTest(ERP5TypeTestCase):
if error:
self.fail(error)
def test_raiseFixApplied(self):
self._testFixer('raise')
def test_importFixApplied(self):
self._testFixer('import')
def test_applyFixApplied(self):
self._testFixer('apply')
def test_hasKeyFixApplied(self):
self._testFixer('has_key')
def test_importFixApplied(self):
self._testFixer('import')
def test_numliteralsFixApplied(self):
self._testFixer('numliterals')
def test_raiseFixApplied(self):
self._testFixer('raise')
def test_suite():
suite = unittest.TestSuite()
......
......@@ -27,7 +27,7 @@ class TestField:
class ValidatorTestCase(unittest.TestCase):
def assertValidatorRaises(self, exception, error_key, f, *args, **kw):
try:
apply(f, args, kw)
f(*args, **kw)
except exception as e:
if hasattr(e, 'error_key') and e.error_key != error_key:
self.fail('Got wrong error. Expected %s received %s' %
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment