summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-13 02:00:38 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-13 02:00:38 +0000
commit4ecca529eb6de9fe55b6fd91fe8273685f9fc314 (patch)
treee00a7c6792c0e9f028e458464d9d929cdc936254
parent9293df039dbdccb15857fe0f8dccad3d202f3423 (diff)
downloadportage-4ecca529eb6de9fe55b6fd91fe8273685f9fc314.tar.gz
portage-4ecca529eb6de9fe55b6fd91fe8273685f9fc314.tar.bz2
portage-4ecca529eb6de9fe55b6fd91fe8273685f9fc314.zip
Return early from NewsManager.updateItems() if the news path listdir call
fails. svn path=/main/trunk/; revision=11869
-rw-r--r--pym/portage/news.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/pym/portage/news.py b/pym/portage/news.py
index 332e05dc1..39589b55d 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -73,12 +73,10 @@ class NewsManager(object):
raise ValueError("Invalid repoID: %s" % repoid)
path = os.path.join(self.portdb.getRepositoryPath(repoid), self.news_path)
-
- # Skip reading news for repoid if the news dir does not exist. Requested by
- # NightMorph :)
- if not os.path.exists(path):
- return None
- news = os.listdir(path)
+ try:
+ news = os.listdir(path)
+ except OSError:
+ return
skipfile = os.path.join(self.unread_path, "news-%s.skip" % repoid)
skiplist = set(grabfile(skipfile))