From cd74538adf5023a2567de01302a282df7d7e0613 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 26 Dec 2007 21:09:04 +0000 Subject: [PATCH] check for bookmark first --- src/bookmark.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bookmark.py b/src/bookmark.py index 03b7f141f..725def89f 100644 --- a/src/bookmark.py +++ b/src/bookmark.py @@ -108,12 +108,13 @@ class BookmarkManager: else: path = os.path.join(common.CONFIG_DIR, "mozilla", "bookmarks.save") - try: - bookmark_file = open(path, "rb") - bookmarks = cPickle.load(bookmark_file) - bookmark_file.close() - except Exception, e: - print "Unable to load bookmarks file: %s", e + if os.path.exists(path): + try: + bookmark_file = open(path, "rb") + bookmarks = cPickle.load(bookmark_file) + bookmark_file.close() + except Exception, e: + print "Unable to load bookmarks file: %s", e if bookmarks == None: return