git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitview: import only one of gtksourceview and gtksourceview2
@ 2007-11-19 10:37 Anton Gyllenberg
  0 siblings, 0 replies; only message in thread
From: Anton Gyllenberg @ 2007-11-19 10:37 UTC (permalink / raw)
  To: git, gitster; +Cc: Anton Gyllenberg

Importing both gtksourceview and gtksourceview2 will make python segfault
on my system (ubuntu 7.10). Change so that gtksourceview is only imported
if importing gtksourceview2 fails. This should be safe as gtksourceview
is only used if gtksourceview2 is not available.

Signed-off-by: Anton Gyllenberg <anton@iki.fi>
---
 contrib/gitview/gitview |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview
index 449ee69..4c99dfb 100755
--- a/contrib/gitview/gitview
+++ b/contrib/gitview/gitview
@@ -27,20 +27,17 @@ import math
 import string
 import fcntl
 
+have_gtksourceview2 = False
+have_gtksourceview = False
 try:
     import gtksourceview2
     have_gtksourceview2 = True
 except ImportError:
-    have_gtksourceview2 = False
-
-try:
-    import gtksourceview
-    have_gtksourceview = True
-except ImportError:
-    have_gtksourceview = False
-
-if not have_gtksourceview2 and not have_gtksourceview:
-    print "Running without gtksourceview2 or gtksourceview module"
+    try:
+        import gtksourceview
+        have_gtksourceview = True
+    except ImportError:
+        print "Running without gtksourceview2 or gtksourceview module"
 
 re_ident = re.compile('(author|committer) (?P<ident>.*) (?P<epoch>\d+) (?P<tz>[+-]\d{4})')
 
-- 
1.5.3.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-19 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 10:37 [PATCH] gitview: import only one of gtksourceview and gtksourceview2 Anton Gyllenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).