Just use os.listdir() since portage.listdir() is unnecessary.
authorZac Medico <zmedico@gentoo.org>
Tue, 21 Aug 2007 07:36:11 +0000 (07:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 21 Aug 2007 07:36:11 +0000 (07:36 -0000)
svn path=/main/trunk/; revision=7651

pym/portage/elog/messages.py

index c2b21ac800f4bd6c6b04401aef0fd7dbf8ff918b..e900800627fe0e834c2993c8e44b751842f1fc11 100644 (file)
@@ -7,17 +7,19 @@ from portage.output import colorize
 from portage.const import EBUILD_PHASES
 from portage.util import writemsg
 
-from portage import listdir
-
 import os
 
 def collect_ebuild_messages(path):
        """ Collect elog messages generated by the bash logging function stored 
                at 'path'.
        """
-       mylogfiles = listdir(path)
+       mylogfiles = None
+       try:
+               mylogfiles = os.listdir(path)
+       except OSError:
+               pass
        # shortcut for packages without any messages
-       if len(mylogfiles) == 0:
+       if not mylogfiles:
                return {}
        # exploit listdir() file order so we process log entries in chronological order
        mylogfiles.reverse()