Commit 0924a16f authored by Jason Madden's avatar Jason Madden

Fix test under PyPy

parent 3841f613
......@@ -37,16 +37,23 @@ def __import__(*args, **kwargs):
# however, so this is necessary.
args = args[1:]
imp.acquire_lock()
try:
try:
_g_import_lock.acquire()
except RuntimeError:
# we've seen this under PyPy, a recursion error
# importing 'platform'
return _import(*args, **kwargs)
try:
result = _import(*args, **kwargs)
finally:
_g_import_lock.release()
finally:
imp.release_lock()
return result
if sys.version_info[:2] < (3, 3):
if sys.version_info[:2] >= (3, 3):
__implements__ = []
else:
__implements__ = ['__import__']
......
......@@ -2,6 +2,7 @@
# See https://github.com/gevent/gevent/issues/108
import gevent
from gevent import monkey
monkey.patch_all()
import_errors = []
......@@ -13,6 +14,7 @@ def some_func():
assert x == 'done'
except ImportError as e:
import_errors.append(e)
raise
gs = [gevent.spawn(some_func) for i in range(2)]
gevent.joinall(gs)
......
......@@ -59,13 +59,13 @@ if LEAKTEST:
if PYPY:
FAILING_TESTS += [
# Different in PyPy:
## Different in PyPy:
# Not implemented:
## Not implemented:
# ---
## ---
# BUGS:
## BUGS:
]
......
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