pygobject / pgi-docgen

API Documentation Generator for PyGObject
https://lazka.github.io/pgi-docs/
GNU Lesser General Public License v2.1
127 stars 36 forks source link

Fix mergeindex list issue #210

Open fcole90 opened 1 year ago

fcole90 commented 1 year ago

Hi and thanks for this awesome library.

While running it, I encountered the following error:

$ ./tools/build.sh Gtk-3.0
All done
Traceback (most recent call last):
  File "/home/fabio/Projects/scratches/pgi-docgen/./pgi-docgen", line 14, in <module>
    sys.exit(main(sys.argv))
  File "/home/fabio/Projects/scratches/pgi-docgen/pgidocgen/main.py", line 29, in main
    return args.func(args)
  File "/home/fabio/Projects/scratches/pgi-docgen/pgidocgen/build.py", line 260, in main
    mergeindex(target_path)
  File "/home/fabio/Projects/scratches/pgi-docgen/pgidocgen/mergeindex.py", line 170, in mergeindex
    output = merger.merge()
  File "/home/fabio/Projects/scratches/pgi-docgen/pgidocgen/mergeindex.py", line 123, in merge
    for attr, v in attributes.items():
AttributeError: 'list' object has no attribute 'items'

It seems the mergeindex file was mistaking a list for a dictionary. I added some typing to aid me with fixing the issue. I think this mostly makes sense (and the error is no longer there) but I'm not 100% sure about the output type. I can say that it's now coherent with the input and at least produces a final merged index :blush: