X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=src%2Fpyutils%2Fparallelize%2Fsmart_future.py;h=6da4db2da1c042030503903f6e9434f1b4e41494;hb=HEAD;hp=b722cfecb5d6e4b525bf5770ae1014634fd5d787;hpb=38b139bc6d720b52765b6058d90752427a6a7e56;p=pyutils.git diff --git a/src/pyutils/parallelize/smart_future.py b/src/pyutils/parallelize/smart_future.py index b722cfe..6da4db2 100644 --- a/src/pyutils/parallelize/smart_future.py +++ b/src/pyutils/parallelize/smart_future.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# © Copyright 2021-2022, Scott Gasch +# © Copyright 2021-2023, Scott Gasch """ A :class:`Future` that can be treated as a substutute for the result @@ -79,11 +79,11 @@ def wait_any( if log_exceptions and not f.cancelled(): exception = f.exception() if exception is not None: - logger.warning( + logger.exception( "Future 0x%x raised an unhandled exception and exited.", id(f), + exc_info=exception, ) - logger.exception(exception) raise exception yield smart_future_by_real_future[f] except concurrent.futures.TimeoutError: @@ -125,11 +125,11 @@ def wait_all( if not f.cancelled(): exception = f.exception() if exception is not None: - logger.warning( + logger.exception( "Future 0x%x raised an unhandled exception and exited.", id(f), + exc_info=exception, ) - logger.exception(exception) raise exception assert len(done) == len(real_futures) assert len(not_done) == 0