mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Get rid of many apply() calls.
This commit is contained in:
parent
f389c77273
commit
68468eba63
38 changed files with 85 additions and 91 deletions
|
@ -115,7 +115,7 @@ class TestResult:
|
|||
|
||||
def _exc_info_to_string(self, err):
|
||||
"""Converts a sys.exc_info()-style tuple of values into a string."""
|
||||
return string.join(apply(traceback.format_exception, err), '')
|
||||
return string.join(traceback.format_exception(*err), '')
|
||||
|
||||
def __repr__(self):
|
||||
return "<%s run=%i errors=%i failures=%i>" % \
|
||||
|
@ -276,7 +276,7 @@ class TestCase:
|
|||
unexpected exception.
|
||||
"""
|
||||
try:
|
||||
apply(callableObj, args, kwargs)
|
||||
callableObj(*args, **kwargs)
|
||||
except excClass:
|
||||
return
|
||||
else:
|
||||
|
@ -561,7 +561,7 @@ class _WritelnDecorator:
|
|||
return getattr(self.stream,attr)
|
||||
|
||||
def writeln(self, *args):
|
||||
if args: apply(self.write, args)
|
||||
if args: self.write(*args)
|
||||
self.write('\n') # text-mode streams translate to \r\n if needed
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue