{"thread":{"id":"10926","subject":"[PATCH] gitview: import only one of gtksourceview and gtksourceview2","startedAt":"2007-11-19T10:37:16Z","lastAt":"2007-11-19T10:37:16Z","messageCount":1,"participants":["Anton Gyllenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"60286","messageId":"1195468636-3468-1-git-send-email-anton@iki.fi","threadId":"10926","inReplyTo":null,"subject":"[PATCH] gitview: import only one of gtksourceview and gtksourceview2","fromName":"Anton Gyllenberg","fromEmail":"anton@iki.fi","sentAt":"2007-11-19T10:37:16Z","receivedAt":"2007-11-19T10:37:16Z","isPatch":true,"sender":{"key":"anton@iki.fi","avatar":null},"body":"Importing both gtksourceview and gtksourceview2 will make python segfault\non my system (ubuntu 7.10). Change so that gtksourceview is only imported\nif importing gtksourceview2 fails. This should be safe as gtksourceview\nis only used if gtksourceview2 is not available.\n\nSigned-off-by: Anton Gyllenberg <anton@iki.fi>\n---\n contrib/gitview/gitview |   17 +++++++----------\n 1 files changed, 7 insertions(+), 10 deletions(-)\n\ndiff --git a/contrib/gitview/gitview b/contrib/gitview/gitview\nindex 449ee69..4c99dfb 100755\n--- a/contrib/gitview/gitview\n+++ b/contrib/gitview/gitview\n@@ -27,20 +27,17 @@ import math\n import string\n import fcntl\n \n+have_gtksourceview2 = False\n+have_gtksourceview = False\n try:\n     import gtksourceview2\n     have_gtksourceview2 = True\n except ImportError:\n-    have_gtksourceview2 = False\n-\n-try:\n-    import gtksourceview\n-    have_gtksourceview = True\n-except ImportError:\n-    have_gtksourceview = False\n-\n-if not have_gtksourceview2 and not have_gtksourceview:\n-    print \"Running without gtksourceview2 or gtksourceview module\"\n+    try:\n+        import gtksourceview\n+        have_gtksourceview = True\n+    except ImportError:\n+        print \"Running without gtksourceview2 or gtksourceview module\"\n \n re_ident = re.compile('(author|committer) (?P<ident>.*) (?P<epoch>\\d+) (?P<tz>[+-]\\d{4})')\n \n-- \n1.5.3.2\n"}]}