From: Jason Stubbs Date: Sun, 2 Apr 2006 08:05:36 +0000 (-0000) Subject: Make the reading of /proc//fd/ impervious to the possible addition X-Git-Tag: v2.1_pre8~45 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a6ae48f2f18689b2cb5d6a65be31f72ea8c765fb;p=portage.git Make the reading of /proc//fd/ impervious to the possible addition of non-numerically named entries. svn path=/main/trunk/; revision=3055 --- diff --git a/pym/portage_exec.py b/pym/portage_exec.py index e800376dc..4f7fef2b9 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)