Unwrap defer.gatherResults failures

This commit is contained in:
Erik Johnston 2015-05-12 13:14:29 +01:00
parent da6a7bbdde
commit 95dedb866f
6 changed files with 18 additions and 7 deletions

View file

@ -23,6 +23,12 @@ import logging
logger = logging.getLogger(__name__)
def unwrapFirstError(failure):
# defer.gatherResults and DeferredLists wrap failures.
failure.trap(defer.FirstError)
return failure.value.subFailure
class Clock(object):
"""A small utility that obtains current time-of-day so that time may be
mocked during unit-tests.