diff options
| author | Scott <[email protected]> | 2022-01-30 21:29:34 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-01-30 21:29:34 -0800 |
| commit | 865825894beeedd47d26dd092d40bfee582f5475 (patch) | |
| tree | a439e1a8ba4a013c57779f9399ed298fdbaa4000 /smart_future.py | |
| parent | 5e09a33068fcdf6d43f12477dd943e108e11ae06 (diff) | |
Change locking boundaries for shared dict. Add a unit test.
Make smart_futures re-raise exceptions that happened in futures.
Mess with file_utils.
Diffstat (limited to 'smart_future.py')
| -rw-r--r-- | smart_future.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/smart_future.py b/smart_future.py index c96c5a7..2f3cbd9 100644 --- a/smart_future.py +++ b/smart_future.py @@ -40,8 +40,11 @@ def wait_any( if log_exceptions and not f.cancelled(): exception = f.exception() if exception is not None: + logger.warning( + f'Future {id(f)} raised an unhandled exception and exited.' + ) logger.exception(exception) - traceback.print_tb(exception.__traceback__) + raise exception yield smart_future_by_real_future[f] if callback is not None: callback() @@ -62,8 +65,11 @@ def wait_all( if not f.cancelled(): exception = f.exception() if exception is not None: + logger.warning( + f'Future {id(f)} raised an unhandled exception and exited.' + ) logger.exception(exception) - traceback.print_tb(exception.__traceback__) + raise exception assert len(done) == len(real_futures) assert len(not_done) == 0 |
