pdoc3 / pdoc

:snake: :arrow_right: :scroll: Auto-generate API documentation for Python projects
https://pdoc3.github.io/pdoc/
GNU Affero General Public License v3.0
1.12k stars 145 forks source link

Fix a fatal error preventing documentation generation in some cases #302

Closed mn3mos closed 2 months ago

mn3mos commented 3 years ago

Got a fatal exception on this line, which prevented the generation of the documentation.

The problem is that some variable is initialized in a try bloc but still used out of it afterwards. If the getattr fails line 682 - which was my problem - then the variable is used without being initialized, which lead to fatal error.

kernc commented 3 years ago

If the getattr fails line 682 - which was my problem - then the variable is used without being initialized

That should be caught by AttributeError or what do you mean variable fails? Can you construct a mwe example that reproduces the issue? This was just recently touched in https://github.com/pdoc3/pdoc/commit/9bdb076e267b33949fb6ffc906316e8651d5f474.