From: Zac Medico Date: Tue, 21 Aug 2007 07:36:11 +0000 (-0000) Subject: Just use os.listdir() since portage.listdir() is unnecessary. X-Git-Tag: v2.2_pre1~872 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f7e9270a9ec482ddd2fd3bf5e75b4cf7aa826cb5;p=portage.git Just use os.listdir() since portage.listdir() is unnecessary. svn path=/main/trunk/; revision=7651 --- diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py index c2b21ac80..e90080062 100644 --- a/pym/portage/elog/messages.py +++ b/pym/portage/elog/messages.py @@ -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()