Skip to content

Commit

Permalink
Skip tracebacks for keyboard interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
danijar committed May 11, 2024
1 parent 7685ecc commit 2682b5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zerofun/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.0.5'
__version__ = '2.0.6'

import multiprocessing as mp
try:
Expand Down
2 changes: 2 additions & 0 deletions zerofun/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def _wrapper(fn, name, args, lock, errqueue, inits):
fn = cloudpickle.loads(fn)
fn(*args)
sys.exit(0)
except (SystemExit, KeyboardInterrupt):
pass
except Exception as e:
utils.warn_remote_error(e, name, lock)
errqueue.put(e)
Expand Down
4 changes: 2 additions & 2 deletions zerofun/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def __repr__(self):
def _wrapper(self, *args):
try:
self.fn(*args)
except SystemExit:
return
except (SystemExit, KeyboardInterrupt):
pass
except Exception as e:
utils.warn_remote_error(e, self.name)
self._exitcode = 1
Expand Down

0 comments on commit 2682b5e

Please sign in to comment.