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

Adds guard against case in which originating_function is None or source #770

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

elijahbenizzy
Copy link
Collaborator

code is unavailable.

Solves two problems:

  1. Originating_functions is None (in the spec)
  2. We can't get source code

This is currently a high-level exception catch-all. We will likely be narrowing to the specific one.

Currently we're only testing the originating_functions for None in unit tests, the other case (an exception) is harder to test for and likely to change.

Comment on lines 160 to 161
return hash_source_code(self.originating_functions[0], strip=True)
except Exception:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit test for this part?

code is unavailable.

Solves two problems:
1. Originating_functions is None (in the spec)
2. We can't get source code

This is currently a high-level exception catch-all. We will likely be
narrowing to the specific one.

Currently we're only testing the originating_functions for None in unit
tests, the other case (an exception) is harder to test for and likely to
change.
@elijahbenizzy elijahbenizzy force-pushed the fix-originating-functions-version branch from 5e43fcb to 9521df5 Compare March 19, 2024 21:33
@elijahbenizzy elijahbenizzy merged commit cd5114c into main Mar 19, 2024
22 of 23 checks passed
@elijahbenizzy elijahbenizzy deleted the fix-originating-functions-version branch March 19, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants