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

Remove try/except logic for importing Empty from queue library #9877

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

QMalcolm
Copy link
Contributor

@QMalcolm QMalcolm commented Apr 8, 2024

resolves #9876

Problem

Following PEP8 the Python 2 library Queue was renamed to queue in Python 3. Our try/except logic was to ensure the Empty class was imported without error when running Python 2. Python 2 went EOL January 1st, 2020 and we haven't supported Python 2 in a very long time. As such, it seems past time to remove this relic.

Solution

Delete the legacy try/except code that is no longer needed

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

Following [PEP8](https://peps.python.org/pep-0008/#package-and-module-names)
the Python 2 library `Queue` was renamed to `queue` in [Python 3](https://peps.python.org/pep-3108/#pep-8-violations-done).
Our try/except logic was to ensure the `Empty` class was imported without
error when running Python 2. Python 2 went EOL January 1st, 2020 and we
haven't supported Python 2 in a very long time. As such, it seems past time
to remove this relic.
@QMalcolm QMalcolm added Skip Changelog Skips GHA to check for changelog file tidy_first "Tidy First" incremental cleanup changes labels Apr 8, 2024
@QMalcolm QMalcolm requested a review from a team as a code owner April 8, 2024 19:24
@cla-bot cla-bot bot added the cla:yes label Apr 8, 2024
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.07%. Comparing base (e81f7fd) to head (7853894).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9877      +/-   ##
==========================================
- Coverage   88.13%   88.07%   -0.06%     
==========================================
  Files         178      178              
  Lines       22456    22456              
==========================================
- Hits        19792    19779      -13     
- Misses       2664     2677      +13     
Flag Coverage Δ
integration 85.44% <ø> (-0.15%) ⬇️
unit 61.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@aranke aranke left a comment

Choose a reason for hiding this comment

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

Love to see it!

@QMalcolm QMalcolm merged commit cf08b84 into main Apr 8, 2024
68 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--tidy-remove-Queue-python-2-compat branch April 8, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file tidy_first "Tidy First" incremental cleanup changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove legacy try/except logic for importing Emtpy from queue
2 participants