Commit 62491305 authored by Jason Madden's avatar Jason Madden

Python 3 imports for PyPy3 in lock.py. Fixes #866

parent 750e0bc4
...@@ -66,6 +66,8 @@ Platforms ...@@ -66,6 +66,8 @@ Platforms
* SSLSocket.recv(0) or read(0) returns an empty byte string. This is * SSLSocket.recv(0) or read(0) returns an empty byte string. This is
a fix for `Python bug #23804 <http://bugs.python.org/issue23804>`_ a fix for `Python bug #23804 <http://bugs.python.org/issue23804>`_
which has been merged into Python 2.7 and Python 3. which has been merged into Python 2.7 and Python 3.
- PyPy3 5.5.0 (supporting Python 3.3.5) is now tested and passes the
test suite. Thanks to btegs for :issue:`866`, XXX.
Stdlib Compatibility Stdlib Compatibility
-------------------- --------------------
......
...@@ -23,6 +23,11 @@ __all__ = [ ...@@ -23,6 +23,11 @@ __all__ = [
# to use locks *other* than the one being traced.) # to use locks *other* than the one being traced.)
if PYPY: if PYPY:
# TODO: Need to use monkey.get_original? # TODO: Need to use monkey.get_original?
try:
from _thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression
from _thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression
except ImportError:
# Python 2
from thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression from thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression
from thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression from thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression
_sem_lock = _allocate_lock() _sem_lock = _allocate_lock()
......
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