You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/gobject-introspection/files/gobject-introspection-1.34....

44 lines
1.4 KiB

From 3e452d88e285531f78707de9a0326649d537e59f Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gentoo.org>
Date: Sat, 29 Dec 2012 05:22:08 -0500
Subject: [PATCH] scanner: add filename/line to the backtrace if
parse_comment_block() raised an exception
In most cases, such exceptions are caused by gtk-doc syntax errors in
annotations, and developers want to see which annotation made g-ir-scanner
crash.
https://bugzilla.gnome.org/show_bug.cgi?id=690850
---
giscanner/annotationparser.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index f545590..f33e956 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -24,6 +24,7 @@
import re
+import traceback
from . import message
from .odict import odict
@@ -766,7 +767,11 @@ class AnnotationParser(object):
comment_blocks = {}
for comment in comments:
- comment_block = self.parse_comment_block(comment)
+ try:
+ comment_block = self.parse_comment_block(comment)
+ except:
+ message.fatal("error when parsing comment block\n%s" % traceback.format_exc(),
+ message.Position(comment[1], comment[2]))
if comment_block is not None:
# Note: previous versions of this parser did not check
--
1.8.0.2