FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(typer): Guard against module shadowing by alexander-alderman-webb · Pull Request #5253 · getsentry/sentry-python · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 2 additions & 1 deletion sentry_sdk/integrations/typer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

try:
import typer
from typer.main import except_hook
except ImportError:
raise DidNotEnable("Typer not installed")

Expand All @@ -31,7 +32,7 @@ class TyperIntegration(Integration):

@staticmethod
def setup_once() -> None:
typer.main.except_hook = _make_excepthook(typer.main.except_hook) # type: ignore
typer.main.except_hook = _make_excepthook(except_hook) # type: ignore


def _make_excepthook(old_excepthook: "Excepthook") -> "Excepthook":
Expand Down
1 change: 0 additions & 1 deletion tests/test_shadowed_module.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def pytest_generate_tests(metafunc):
- {
"litellm",
"ray",
"typer",
},
)

Expand Down
Loading

Back | FazBrowse Home | New Git URL