diff options
author | ndparker <ndparker@users.noreply.github.com> | 2014-09-23 23:28:11 +0200 |
---|---|---|
committer | ndparker <ndparker@users.noreply.github.com> | 2014-09-23 23:28:11 +0200 |
commit | ce52dd9e3b71f2074d7821fe62803d4e0eefe512 (patch) | |
tree | f0f9356075b7d85469a98180d17a5e2c91c058e5 /lib/sqlalchemy/util/langhelpers.py | |
parent | 360477cc3af826b5056039b9a19ec3ecb2b94ede (diff) | |
download | sqlalchemy-ce52dd9e3b71f2074d7821fe62803d4e0eefe512.tar.gz |
improve exception vs. exit handling
Diffstat (limited to 'lib/sqlalchemy/util/langhelpers.py')
-rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 76f85f605..75c6e7b46 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -490,6 +490,8 @@ def generic_repr(obj, additional_kw=(), to_inspect=None, omit_kwarg=()): val = getattr(obj, arg, missing) if val is not missing and val != defval: output.append('%s=%r' % (arg, val)) + except (SystemExit, KeyboardInterrupt): + raise except: pass @@ -499,6 +501,8 @@ def generic_repr(obj, additional_kw=(), to_inspect=None, omit_kwarg=()): val = getattr(obj, arg, missing) if val is not missing and val != defval: output.append('%s=%r' % (arg, val)) + except (SystemExit, KeyboardInterrupt): + raise except: pass @@ -1185,6 +1189,8 @@ def warn_exception(func, *args, **kwargs): """ try: return func(*args, **kwargs) + except (SystemExit, KeyboardInterrupt): + raise except: warn("%s('%s') ignored" % sys.exc_info()[0:2]) |