Commit ee9f6785 authored by Jason Madden's avatar Jason Madden

Don't override builtin name.

parent 4de8abc2
...@@ -582,16 +582,16 @@ class Hub(greenlet): ...@@ -582,16 +582,16 @@ class Hub(greenlet):
if cb is not None: if cb is not None:
cb.stop() cb.stop()
def print_exception(self, context, type, value, tb): def print_exception(self, context, type_, value, tb):
# Python 3 does not gracefully handle None value or tb in # Python 3 does not gracefully handle None value or tb in
# traceback.print_exception() as previous versions did. # traceback.print_exception() as previous versions did.
errstream = sys.stderr errstream = sys.stderr
if type(errstream).__name__ == 'FileObjectThread': if type(errstream).__name__ == 'FileObjectThread':
errstream = errstream.io # pylint:disable=no-member errstream = errstream.io # pylint:disable=no-member
if value is None: if value is None:
errstream.write('%s\n' % type.__name__) errstream.write('%s\n' % type_.__name__)
else: else:
traceback.print_exception(type, value, tb, file=errstream) traceback.print_exception(type_, value, tb, file=errstream)
del tb del tb
if context is not None: if context is not None:
if not isinstance(context, str): if not isinstance(context, str):
...@@ -600,7 +600,7 @@ class Hub(greenlet): ...@@ -600,7 +600,7 @@ class Hub(greenlet):
except: except:
traceback.print_exc(file=errstream) traceback.print_exc(file=errstream)
context = repr(context) context = repr(context)
errstream.write('%s failed with %s\n\n' % (context, getattr(type, '__name__', 'exception'), )) errstream.write('%s failed with %s\n\n' % (context, getattr(type_, '__name__', 'exception'), ))
def switch(self): def switch(self):
switch_out = getattr(getcurrent(), 'switch_out', None) switch_out = getattr(getcurrent(), 'switch_out', None)
......
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