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

🐛add fix/workaround for old python versions #11

Merged
merged 3 commits into from
May 24, 2024
Merged

Conversation

dyollb
Copy link
Owner

@dyollb dyollb commented May 24, 2024

What do these changes do?

This PR fixes issues related to using e.g. Enums as argument when from __future__ import annotations is used.

In this situation, the annotation is provided as string and the line annotation = eval(annotation, globals, locals) raises a NameError. The workaround is to pass locals (or globals) to the decorator, so eval knows the class.

Checklist

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Unit tests for the changes and run locally with the command pytest tests
  • Runs on minimum Python version

@dyollb dyollb merged commit ec4e7ff into main May 24, 2024
4 checks passed
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.

1 participant