summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2006-04-02 08:05:36 +0000
committerJason Stubbs <jstubbs@gentoo.org>2006-04-02 08:05:36 +0000
commita6ae48f2f18689b2cb5d6a65be31f72ea8c765fb (patch)
tree66a9862d0b503462e720acafb4b5b0561d43c35c /pym/portage_exec.py
parentAdd a portage_exec.get_open_fds() function for bug #128284. Thanks to Brian H... (diff)
downloadportage-multirepo-a6ae48f2f18689b2cb5d6a65be31f72ea8c765fb.tar.gz
portage-multirepo-a6ae48f2f18689b2cb5d6a65be31f72ea8c765fb.tar.bz2
portage-multirepo-a6ae48f2f18689b2cb5d6a65be31f72ea8c765fb.zip
Make the reading of /proc/<pid>/fd/ impervious to the possible addition
of non-numerically named entries. svn path=/main/trunk/; revision=3055
Diffstat (limited to 'pym/portage_exec.py')
-rw-r--r--pym/portage_exec.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/portage_exec.py b/pym/portage_exec.py
index e800376d..4f7fef2b 100644
--- a/pym/portage_exec.py
+++ b/pym/portage_exec.py
@@ -19,7 +19,7 @@ except ImportError:
if os.path.isdir("/proc/%i/fd" % os.getpid()):
def get_open_fds():
- return map(int, os.listdir("/proc/%i/fd" % os.getpid()))
+ return map(int, [fd for fd in os.listdir("/proc/%i/fd" % os.getpid()) if fd.isdigit()])
else:
def get_open_fds():
return xrange(max_fd_limit)