Gentoo Archives: gentoo-commits

From: "Alexandre Rostovtsev (tetromino)" <tetromino@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/gobject-introspection/files: gobject-introspection-1.34.2-better-traceback.patch
Date: Sat, 29 Dec 2012 10:35:30
Message-Id: 20121229103510.76F2C2171D@flycatcher.gentoo.org
1 tetromino 12/12/29 10:35:10
2
3 Added: gobject-introspection-1.34.2-better-traceback.patch
4 Log:
5 Print the filename and line being parsed if g-ir-scanner crashes while parsing a gtk-doc annotation. Update to EAPI5 and python-single-r1.
6
7 (Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)
8
9 Revision Changes Path
10 1.1 dev-libs/gobject-introspection/files/gobject-introspection-1.34.2-better-traceback.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/gobject-introspection/files/gobject-introspection-1.34.2-better-traceback.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/gobject-introspection/files/gobject-introspection-1.34.2-better-traceback.patch?rev=1.1&content-type=text/plain
14
15 Index: gobject-introspection-1.34.2-better-traceback.patch
16 ===================================================================
17 From 3e452d88e285531f78707de9a0326649d537e59f Mon Sep 17 00:00:00 2001
18 From: Alexandre Rostovtsev <tetromino@g.o>
19 Date: Sat, 29 Dec 2012 05:22:08 -0500
20 Subject: [PATCH] scanner: add filename/line to the backtrace if
21 parse_comment_block() raised an exception
22
23 In most cases, such exceptions are caused by gtk-doc syntax errors in
24 annotations, and developers want to see which annotation made g-ir-scanner
25 crash.
26
27 https://bugzilla.gnome.org/show_bug.cgi?id=690850
28 ---
29 giscanner/annotationparser.py | 7 ++++++-
30 1 file changed, 6 insertions(+), 1 deletion(-)
31
32 diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
33 index f545590..f33e956 100644
34 --- a/giscanner/annotationparser.py
35 +++ b/giscanner/annotationparser.py
36 @@ -24,6 +24,7 @@
37
38
39 import re
40 +import traceback
41
42 from . import message
43 from .odict import odict
44 @@ -766,7 +767,11 @@ class AnnotationParser(object):
45 comment_blocks = {}
46
47 for comment in comments:
48 - comment_block = self.parse_comment_block(comment)
49 + try:
50 + comment_block = self.parse_comment_block(comment)
51 + except:
52 + message.fatal("error when parsing comment block\n%s" % traceback.format_exc(),
53 + message.Position(comment[1], comment[2]))
54
55 if comment_block is not None:
56 # Note: previous versions of this parser did not check
57 --
58 1.8.0.2