From: Anton Gyllenberg Date: Mon, 19 Nov 2007 10:37:16 +0000 (+0200) Subject: gitview: import only one of gtksourceview and gtksourceview2 X-Git-Tag: v1.5.4-rc0~177 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=59adeef48fcc3ea3e1288ce62260fdd8f46240da;p=git.git gitview: import only one of gtksourceview and gtksourceview2 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview index 449ee69bf..4c99dfb90 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.*) (?P\d+) (?P[+-]\d{4})')