-
Notifications
You must be signed in to change notification settings - Fork 532
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
fix(types): Replace custom TYPE_CHECKING with stdlib typing.TYPE_CHECKING #3447
fix(types): Replace custom TYPE_CHECKING with stdlib typing.TYPE_CHECKING #3447
Conversation
…KING
Hey @dev-satoshi, thank you for the quick PR! This works, but I'd prefer if we could remove the |
@sentrivana |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sentrivana
It's done!
Could you please review this when you have a moment?
sentry_sdk/client.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two import statements in this file, so it's better to remove one of them, right?
try: | ||
from typing import TYPE_CHECKING | ||
except ImportError: | ||
TYPE_CHECKING = False | ||
from typing import TYPE_CHECKING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the try-except block since we are now supporting Python 3.6 and above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dev-satoshi! Looks good to me :)
❌ 4 Tests Failed:
View the top 3 failed tests by shortest run timetests.integrations.aws_lambda.test_aws�test_init_error[python3.9] tests.integrations.aws_lambda.test_aws�test_init_error[python3.11] tests.integrations.aws_lambda.test_aws�test_init_error[python3.10] To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
Just fyi, I've pushed a commit that reorders some of the imports (e.g. if the |
All is looking good except for the AWS Lambda tests (this has nothing to do with this PR, we need to fix this on master). We'll probably get around to fixing this early next week and then we can merge this. Nothing additional needed from your side @dev-satoshi -- thanks again for the contribution, we'll see that this is merged next week! |
…KING (getsentry#3447) --------- Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
This commit replaces the custom TYPE_CHECKING constant in _types.py with the standard library's typing.TYPE_CHECKING. This change simplifies the code and removes unnecessary backward compatibility for Python versions below 3.6. Since the _types module is private, this update does not introduce any breaking changes.
Closes #3426