os.listdir("/proc/%d/fd" % pid) throws OSError if 'pid' died since the
list of pids was obtained.
Bug #12375.
Reported-by: Amey Bhide <abhide@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Alban Browaeys prahal@yahoo.com
Alex Yip alex@nicira.com
Alexey I. Froloff raorn@altlinux.org
+Amey Bhide abhide@nicira.com
André Ruß andre.russ@hybris.com
Andreas Beckmann debian@abeckmann.de
Atzm Watanabe atzm@stratosphere.co.jp
except ValueError:
continue
- for fd in os.listdir("/proc/%d/fd" % pid):
+ try:
+ fds = os.listdir("/proc/%d/fd" % pid)
+ except OSError:
+ continue
+
+ for fd in fds:
try:
fd = int(fd)
except ValueError: