Commit 9e2fbdf3 authored by Fantix King's avatar Fantix King

Fix absolute import issue in core.ppyx in PY3, refs #38

parent 72119c8c
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
cimport cython cimport cython
cimport libev cimport libev
from python cimport * from python cimport *
import sys
# Work around lack of absolute_import in Cython # Work around lack of absolute_import in Cython
# Note for PY3: not doing so will leave reference to locals() on import
sys = __import__('sys', level=0)
os = __import__('os', level=0) os = __import__('os', level=0)
import traceback traceback = __import__('traceback', level=0)
import signal as signalmodule signalmodule = __import__('signal', level=0)
__all__ = ['get_version', __all__ = ['get_version',
......
import weakref
class Dummy:
def __init__(self):
__import__('gevent.core')
assert weakref.ref(Dummy())() is None
from gevent import socket
assert weakref.ref(socket.socket())() is None
...@@ -53,6 +53,12 @@ if CPYTHON_DBG: ...@@ -53,6 +53,12 @@ if CPYTHON_DBG:
if PYPY: if PYPY:
FAILING_TESTS += [ FAILING_TESTS += [
# Different in PyPy:
# PyPy has no refcount
# http://pypy.readthedocs.org/en/latest/cpython_differences.html#differences-related-to-garbage-collection-strategies
'test__refcount_core.py',
# Not implemented: # Not implemented:
# stat watchers are not implemented on pypy # stat watchers are not implemented on pypy
......
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