From 5c468691b6accb2c3e910931bc0f60f846fe9e89 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 7 Dec 2017 17:15:20 +0530 Subject: giscanner: Fix GtkDocAnnotations implementation Lesson to be learnt: *NEVER* have a try..except block that catches all exceptions and turns them into warnings that are silenced by default. There was a syntax error in this class implementation that made all annotation parsing fail silently. --- giscanner/annotationparser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 1092310e..79d5212f 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -518,15 +518,15 @@ class GtkDocAnnotations(OrderedDict): __slots__ = ('position') - def __init__(self, position=None, sequence=None): - OrderedDict.__init__(self, sequence) + def __init__(self, *args, position=None, **kwargs): + OrderedDict.__init__(self, *args, **kwargs) #: A :class:`giscanner.message.Position` instance specifying the location of the #: annotations in the source file or :const:`None`. self.position = position def __copy__(self): - return GtkDocAnnotations(self.position, self) + return GtkDocAnnotations(self, position=self.position) class GtkDocAnnotatable(object): @@ -1871,7 +1871,7 @@ class GtkDocCommentBlockParser(object): if parse_options: if annotations is None: - parsed_annotations = GtkDocAnnotations(position) + parsed_annotations = GtkDocAnnotations(position=position) else: parsed_annotations = annotations.copy() else: -- cgit v1.2.1