Commit 8f0924ee authored by Jason Madden's avatar Jason Madden

Fix test__semaphore.py under PyPy3 by raising the right (wrong, really)...

Fix test__semaphore.py under PyPy3 by raising the right (wrong, really) exception type that PyPy does.
parent c93c89fa
......@@ -31,6 +31,7 @@ else:
'start_new']
error = __thread__.error
from gevent._compat import PY3
from gevent._compat import PYPY
from gevent._util import copy_globals
from gevent.hub import getcurrent, GreenletExit
from gevent.greenlet import Greenlet
......@@ -58,6 +59,9 @@ class LockType(BoundedSemaphore):
# and any other API changes we need to make to match behaviour
_OVER_RELEASE_ERROR = __thread__.error
if PYPY and PY3:
_OVER_RELEASE_ERROR = RuntimeError
if PY3:
_TIMEOUT_MAX = __thread__.TIMEOUT_MAX # python 2: pylint:disable=no-member
......
......@@ -67,7 +67,7 @@ class TestLock(greentest.TestCase):
self.fail("Should have thrown an exception")
except Exception as e:
g_exc = e
self.assertTrue(isinstance(g_exc, type(std_exc)), (g_exc, std_exc))
self.assertIsInstance(g_exc, type(std_exc))
if __name__ == '__main__':
......
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