If repo/profiles/news doesn't exist, return 0 updates
authorAlec Warner <antarus@gentoo.org>
Tue, 16 Jan 2007 16:37:46 +0000 (16:37 -0000)
committerAlec Warner <antarus@gentoo.org>
Tue, 16 Jan 2007 16:37:46 +0000 (16:37 -0000)
svn path=/main/trunk/; revision=5672

pym/portage_news.py

index 736ce3fdcaf0a2b14c7cde83bf37b1ce040e427b..7624bed2d08b09996f5351b7bc914bb3e0920d5f 100644 (file)
@@ -60,6 +60,10 @@ class NewsManager(object):
                        timestamp = 0
 
                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 )
                updates = []
                for item in news: