Skip to content

Commit

Permalink
gitview: import only one of gtksourceview and gtksourceview2
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Anton Gyllenberg authored and Junio C Hamano committed Nov 20, 2007
1 parent b7f30e0 commit 59adeef
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions contrib/gitview/gitview
Original file line number Diff line number Diff line change
Expand Up @@ -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})')

Expand Down

0 comments on commit 59adeef

Please sign in to comment.