Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/
Date: Thu, 01 Dec 2011 17:52:56
Message-Id: af013a2de5a2dc7069de5e95c7474556cf9208ab.zmedico@gentoo
1 commit: af013a2de5a2dc7069de5e95c7474556cf9208ab
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 17:52:23 2011 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 17:52:43 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af013a2d
7
8 locks.py: use flock with PyPy for issue 747
9
10 ---
11 pym/portage/locks.py | 5 +++++
12 1 files changed, 5 insertions(+), 0 deletions(-)
13
14 diff --git a/pym/portage/locks.py b/pym/portage/locks.py
15 index 9ed1d6a..9cfb87e 100644
16 --- a/pym/portage/locks.py
17 +++ b/pym/portage/locks.py
18 @@ -8,6 +8,7 @@ __all__ = ["lockdir", "unlockdir", "lockfile", "unlockfile", \
19
20 import errno
21 import fcntl
22 +import platform
23 import stat
24 import sys
25 import time
26 @@ -27,6 +28,10 @@ if sys.hexversion >= 0x3000000:
27 HARDLINK_FD = -2
28 _default_lock_fn = fcntl.lockf
29
30 +if platform.python_implementation() == 'PyPy':
31 + # workaround for https://bugs.pypy.org/issue747
32 + _default_lock_fn = fcntl.flock
33 +
34 # Used by emerge in order to disable the "waiting for lock" message
35 # so that it doesn't interfere with the status display.
36 _quiet = False