From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QUcfm-0001DJ-77 for garchives@archives.gentoo.org; Thu, 09 Jun 2011 10:41:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C88BC1C02E; Thu, 9 Jun 2011 10:41:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 983C31C02E for ; Thu, 9 Jun 2011 10:41:01 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 190891B4026 for ; Thu, 9 Jun 2011 10:41:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0AC328003C for ; Thu, 9 Jun 2011 10:41:00 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <65f3a4d8af054756b9b553c341118334b4526075.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/locks.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 65f3a4d8af054756b9b553c341118334b4526075 Date: Thu, 9 Jun 2011 10:41:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 7de2c9edc22b53b35fd090c9d62591f4 commit: 65f3a4d8af054756b9b553c341118334b4526075 Author: Zac Medico gentoo org> AuthorDate: Thu Jun 9 10:39:37 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Jun 9 10:39:37 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D65f3a4d8 locks: use a private constant for fcntl.lockf --- pym/portage/locks.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pym/portage/locks.py b/pym/portage/locks.py index 1f8f580..50a9200 100644 --- a/pym/portage/locks.py +++ b/pym/portage/locks.py @@ -25,6 +25,7 @@ if sys.hexversion >=3D 0x3000000: basestring =3D str =20 HARDLINK_FD =3D -2 +_default_lock_fn =3D fcntl.lockf =20 # Used by emerge in order to disable the "waiting for lock" message # so that it doesn't interfere with the status display. @@ -109,9 +110,9 @@ def lockfile(mypath, wantnewlockfile=3D0, unlinkfile=3D= 0, =20 # try for a non-blocking lock, if it's held, throw a message # we're waiting on lockfile and use a blocking attempt. - locking_method =3D fcntl.lockf + locking_method =3D _default_lock_fn try: - fcntl.lockf(myfd,fcntl.LOCK_EX|fcntl.LOCK_NB) + locking_method(myfd, fcntl.LOCK_EX|fcntl.LOCK_NB) except IOError as e: if "errno" not in dir(e): raise @@ -135,7 +136,7 @@ def lockfile(mypath, wantnewlockfile=3D0, unlinkfile=3D= 0, out.ebegin(waiting_msg) # try for the exclusive lock now. try: - fcntl.lockf(myfd, fcntl.LOCK_EX) + locking_method(myfd, fcntl.LOCK_EX) except EnvironmentError as e: if out is not None: out.eend(1, str(e))