Skip to content

Commit

Permalink
fix: Don't crash on inspection of functions signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Dec 2, 2022
1 parent 09571bb commit 051e337
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/griffe/agents/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from inspect import Signature, cleandoc, getmodule, ismodule
from inspect import signature as getsignature
from pathlib import Path
from tokenize import TokenError
from typing import Any

from griffe.agents.base import BaseInspector
Expand Down Expand Up @@ -379,7 +378,9 @@ def handle_function(self, node: ObjectNode, labels: set | None = None): # noqa:
"""
try:
signature = getsignature(node.obj)
except (AttributeError, ValueError, TokenError, TypeError):
except Exception:
# so many exceptions can be raised here:
# AttributeError, NameError, RuntimeError, ValueError, TokenError, TypeError
parameters = None
returns = None
else:
Expand Down

0 comments on commit 051e337

Please sign in to comment.