Commit 36d6c13c authored by Denis Bilenko's avatar Denis Bilenko

make GreenletExit a subclass of BaseException but not Exception

parent 5832895e
......@@ -35,6 +35,15 @@ except ImportError:
getcurrent = greenlet.getcurrent
GreenletExit = greenlet.GreenletExit
# In greenlet >= 0.3.2, GreenletExit is a subclass of BaseException
# In greenlet <= 0.3.1, GreenletExit is a subclass of Exception
# Since, GreenletExit is a part of gevent's public interface, we want
# it to be consistent, so if we got older greenlet, we monkey patch
# GreenletExit's __bases__
if GreenletExit.__bases__[0] is Exception:
GreenletExit.__bases__ = (BaseException, )
if sys.version_info[0] <= 2:
thread = __import__('thread')
else:
......
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