Skip to content

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

Merged
kernc merged 2 commits intopdoc3:masterfrom
mn3mos:patch-1
Jun 22, 2024
Merged

Fix a fatal error preventing documentation generation in some cases#302
kernc merged 2 commits intopdoc3:masterfrom
mn3mos:patch-1

Conversation

@mn3mos
Copy link
Copy Markdown
Contributor

@mn3mos mn3mos commented Jan 18, 2021

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
Copy link
Copy Markdown
Member

kernc commented Jan 18, 2021

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 9bdb076.

mn3mos and others added 2 commits June 22, 2024 02:08
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 kernc merged commit 3bf1cd8 into pdoc3:master Jun 22, 2024
kernc pushed a commit to johann-petrak/pdoc that referenced this pull request Jun 22, 2024
…ses (pdoc3#302)

* Update __init__.py

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.

* Use `try-else` block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants