Commit ec46093c authored by Jason Madden's avatar Jason Madden

Cleaner handling of errors at interpreter shutdown on Py2. Ref #802.

parent 8df44277
......@@ -29,7 +29,7 @@ else:
## Exceptions
if PY3:
def reraise(t, value, tb=None): # pylint:disable=unused-argument
if value.__traceback__ is not tb:
if value.__traceback__ is not tb and tb is not None:
raise value.with_traceback(tb)
raise value
......
......@@ -329,6 +329,10 @@ def install():
def _unlocked_imports(f):
def g(a):
if sys is None: # pragma: no cover
# interpreter shutdown on Py2
return
gb = None
if 'gevent.builtins' in sys.modules:
gb = sys.modules['gevent.builtins']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment