For consistency, make get_open_fds() return a plain iterator in any case,
authorZac Medico <zmedico@gentoo.org>
Fri, 15 Aug 2008 18:45:07 +0000 (18:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 15 Aug 2008 18:45:07 +0000 (18:45 -0000)
rather than return a list in some cases.

svn path=/main/trunk/; revision=11418

pym/portage/process.py

index 6a8a59ff7ecd4cf8c87d8ac5aed54d44771b5b0b..3bc6bd1a8cbdc7df38450ae1f04ac7b93065c2b8 100644 (file)
@@ -21,8 +21,8 @@ except ImportError:
 
 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()]
+               return (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)