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

fix(pure-eval): Guard against module shadowing by alexander-alderman-webb · Pull Request #5252 · 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
8 changes: 4 additions & 4 deletions sentry_sdk/integrations/pure_eval.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 @@ -15,12 +15,12 @@
from sentry_sdk._types import Event, Hint

try:
import executing
from executing import Source
except ImportError:
raise DidNotEnable("executing is not installed")

try:
import pure_eval
from pure_eval import Evaluator
except ImportError:
raise DidNotEnable("pure_eval is not installed")

Expand Down Expand Up @@ -81,7 +81,7 @@ def add_executing_info(


def pure_eval_frame(frame: "FrameType") -> "Dict[str, Any]":
source = executing.Source.for_frame(frame)
source = Source.for_frame(frame)
if not source.tree:
return {}

Expand All @@ -98,7 +98,7 @@ def pure_eval_frame(frame: "FrameType") -> "Dict[str, Any]":
if isinstance(scope, (ast.FunctionDef, ast.ClassDef, ast.Module)):
break

evaluator = pure_eval.Evaluator.from_frame(frame)
evaluator = Evaluator.from_frame(frame)
expressions = evaluator.interesting_expressions_grouped(scope)

def closeness(expression: "Tuple[List[Any], Any]") -> "Tuple[int, int]":
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 @@ -30,7 +30,6 @@ def pytest_generate_tests(metafunc):
submodule_names
- {
"litellm",
"pure_eval",
"ray",
"typer",
},
Expand Down
Loading

Back | FazBrowse Home | New Git URL