Use a list comprehension instead of strange map() usage which yields odd
authorZac Medico <zmedico@gentoo.org>
Fri, 15 Aug 2008 18:12:33 +0000 (18:12 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 15 Aug 2008 18:12:33 +0000 (18:12 -0000)
results when fed to the py3k converter. Thanks to RenĂ© 'Necoro' Neumann.

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

pym/portage/process.py

index e9a1fab703d20ed491f26940efa501836d91e824..6a8a59ff7ecd4cf8c87d8ac5aed54d44771b5b0b 100644 (file)
@@ -21,7 +21,8 @@ except ImportError:
 
 if os.path.isdir("/proc/%i/fd" % os.getpid()):
        def get_open_fds():
-               return map(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)