Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't misuse KeyError for the custom names function. #126

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

danthedeckie
Copy link
Owner

Description

See #94

Makes KeyError and stuff a bit more friendly for users using a custom names lookup.

If their names function throws a KeyError unexpectedly, it was getting caught incorrectly.

This expands the documentation & makes it so that people using a custom names resolver should deliberately only throw a simpleeval.NameNotDefined, other exceptions would be raised correctly.

@codecov
Copy link

codecov bot commented Feb 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.21%. Comparing base (166e90f) to head (ee16fd3).
Report is 3 commits behind head on 1.0.0.

Additional details and impacted files
@@            Coverage Diff             @@
##            1.0.0     #126      +/-   ##
==========================================
+ Coverage   99.20%   99.21%   +0.01%     
==========================================
  Files           2        2              
  Lines        1128     1150      +22     
==========================================
+ Hits         1119     1141      +22     
  Misses          9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
simpleeval.py Show resolved Hide resolved
@danthedeckie danthedeckie force-pushed the better-names-exceptions branch from 219de17 to d95f26e Compare October 4, 2024 21:14
@danthedeckie danthedeckie changed the base branch from master to 1.0.0 October 4, 2024 21:14
Co-authored-by: Kurt McKee <[email protected]>
@danthedeckie danthedeckie force-pushed the better-names-exceptions branch from d95f26e to ee16fd3 Compare October 4, 2024 21:15
@danthedeckie danthedeckie merged commit 014f2e8 into 1.0.0 Oct 4, 2024
16 checks passed
@danthedeckie danthedeckie deleted the better-names-exceptions branch October 4, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants