[jhbuild] packagedb: Handle non-existent file correctly



commit 7058e1e71cd3612b272b8c8ef7de4c0ae20f8712
Author: Colin Walters <walters verbum org>
Date:   Wed Jun 15 20:11:28 2011 -0400

    packagedb: Handle non-existent file correctly

 jhbuild/utils/packagedb.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/utils/packagedb.py b/jhbuild/utils/packagedb.py
index 4f85bdc..4422295 100644
--- a/jhbuild/utils/packagedb.py
+++ b/jhbuild/utils/packagedb.py
@@ -83,6 +83,8 @@ class PackageDB:
             f = open(self.dbfile)
         except OSError, e:
             return # treat as empty cache
+        except IOError, e:
+            return
         doc = ET.parse(f)
         root = doc.getroot()
         if root.tag != 'packagedb':



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]