[gobject-introspection/wip/meson] giscanner: Fix GtkDocAnnotations implementation



commit abe8c522d70a327a17be726ce4d9b60b081f0e39
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Thu Dec 7 17:15:20 2017 +0530

    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 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 1092310..79d5212 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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]