[gedit] Be robust against query_info failure
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Be robust against query_info failure
- Date: Sun, 16 Sep 2012 20:00:37 +0000 (UTC)
commit 7ba9f68a5bc5bbee07b9ca2b92fae596a0742d51
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Sep 16 21:49:20 2012 +0200
Be robust against query_info failure
plugins/snippets/snippets/document.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/snippets/snippets/document.py b/plugins/snippets/snippets/document.py
index f482723..678aa5e 100644
--- a/plugins/snippets/snippets/document.py
+++ b/plugins/snippets/snippets/document.py
@@ -366,9 +366,13 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
def location_name_for_env(self, location):
if location:
- info = location.query_info("standard::display-name", 0, None)
+ try:
+ info = location.query_info("standard::display-name", 0, None)
+ display_name = info.get_display_name()
+ except:
+ display_name = ''
- return {'utf8': unicode(info.get_display_name(), 'utf-8'),
+ return {'utf8': unicode(display_name, 'utf-8'),
'noenc': location.get_basename()}
else:
return u''
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]