From af013a2de5a2dc7069de5e95c7474556cf9208ab Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 1 Dec 2011 09:52:23 -0800 Subject: locks.py: use flock with PyPy for issue 747 --- pym/portage/locks.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pym/portage/locks.py') diff --git a/pym/portage/locks.py b/pym/portage/locks.py index 9ed1d6a6c..9cfb87e2d 100644 --- a/pym/portage/locks.py +++ b/pym/portage/locks.py @@ -8,6 +8,7 @@ __all__ = ["lockdir", "unlockdir", "lockfile", "unlockfile", \ import errno import fcntl +import platform import stat import sys import time @@ -27,6 +28,10 @@ if sys.hexversion >= 0x3000000: HARDLINK_FD = -2 _default_lock_fn = fcntl.lockf +if platform.python_implementation() == 'PyPy': + # workaround for https://bugs.pypy.org/issue747 + _default_lock_fn = fcntl.flock + # Used by emerge in order to disable the "waiting for lock" message # so that it doesn't interfere with the status display. _quiet = False -- cgit v1.2.3-1-g7c22