[kupfer] plugin.firefox: Catch JSON exception before returning



commit cfec581db22da5cdc4e922449fa84115aa959920
Author: Karol BÄ?dkowski <karol bedkowsk+gh gmail com>
Date:   Wed Oct 21 23:03:28 2009 +0200

    plugin.firefox: Catch JSON exception before returning
    
    Python has problem with catching exceptions inside generator.
    Creating tuple or list from generated items fix this problem.

 kupfer/plugin/firefox.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/firefox.py b/kupfer/plugin/firefox.py
index b334908..8ec9326 100644
--- a/kupfer/plugin/firefox.py
+++ b/kupfer/plugin/firefox.py
@@ -48,7 +48,7 @@ class BookmarksSource (AppLeafContentMixin, Source):
 
 		if fpath and os.path.splitext(fpath)[-1].lower() == ".json":
 			try:
-				return self._get_ffx3_items(fpath)
+				return list(self._get_ffx3_items(fpath))
 			except Exception, exc:
 				# Catch JSON parse errors
 				# different exception for cjson and json



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