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 1RxbEX-0003HJ-26 for garchives@archives.gentoo.org; Wed, 15 Feb 2012 09:33:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D6317E09D0; Wed, 15 Feb 2012 09:32:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AAE28E09D0 for ; Wed, 15 Feb 2012 09:32:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1CC261B401C for ; Wed, 15 Feb 2012 09:32:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A88D4E5400 for ; Wed, 15 Feb 2012 09:32:55 +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: <1329298360.a979c180b5c8ce98231d7e3c20f2d38d272f7b45.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/process.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a979c180b5c8ce98231d7e3c20f2d38d272f7b45 X-VCS-Branch: master Date: Wed, 15 Feb 2012 09:32:55 +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: b2441f8a-4f20-4b26-903f-da86e564fd7b X-Archives-Hash: 8edca270425bf2ee8f636a421c31bb28 commit: a979c180b5c8ce98231d7e3c20f2d38d272f7b45 Author: Zac Medico gentoo org> AuthorDate: Wed Feb 15 09:32:40 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Feb 15 09:32:40 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Da979c180 get_open_fds: handle EAGAIN for PyPy 1.8 --- pym/portage/process.py | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/pym/portage/process.py b/pym/portage/process.py index e7313ab..febaf66 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -1,9 +1,11 @@ # portage.py -- core Portage functionality -# Copyright 1998-2010 Gentoo Foundation +# Copyright 1998-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 =20 import atexit +import errno +import platform import signal import sys import traceback @@ -32,6 +34,18 @@ if os.path.isdir("/proc/%i/fd" % os.getpid()): def get_open_fds(): return (int(fd) for fd in os.listdir("/proc/%i/fd" % os.getpid()) \ if fd.isdigit()) + + if platform.python_implementation() =3D=3D 'PyPy': + # EAGAIN observed with PyPy 1.8. + _get_open_fds =3D get_open_fds + def get_open_fds(): + try: + return _get_open_fds() + except OSError as e: + if e.errno !=3D errno.EAGAIN: + raise + return range(max_fd_limit) + else: def get_open_fds(): return range(max_fd_limit)