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

Fix DeprecationWarning for pkgutil.find_loader #1623

Merged

Conversation

wmorrell
Copy link
Contributor

The find_loader function is deprecated in Python 3.12 and slated for removal in Python 3.14. The function is a wrapper around importlib.util.find_spec, and returning the loader attribute from that call. The code isn't using the loader, and only checking that the import path exists, so we may use the wrapped function directly, instead.

fixes: #1616

The `find_loader` function is deprecated in Python 3.12 and slated for removal
in Python 3.14. The function is a wrapper around `importlib.util.find_spec`,
and returning the `loader` attribute from that call. The code isn't using the
loader, and only checking that the import path exists, so we may use the
wrapped function directly, instead.

fixes: carltongibson#1616
@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4a618e0) 98.59% compared to head (40b0bf3) 98.59%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1623   +/-   ##
=======================================
  Coverage   98.59%   98.59%           
=======================================
  Files          15       15           
  Lines        1281     1281           
=======================================
  Hits         1263     1263           
  Misses         18       18           

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

Copy link
Owner

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

Great. Thanks. 🎁

@carltongibson carltongibson merged commit 15a5c72 into carltongibson:main Nov 17, 2023
9 checks passed
sliverc added a commit to sliverc/django-rest-framework-json-api that referenced this pull request Nov 20, 2023
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.

DeprecationWarning: 'pkgutil.find_loader' is deprecated and slated for removal in Python 3.14
3 participants