◐ Shell
clean mode source ↗

gh-97850: Deprecate `find_loader` and `get_loader` in `pkgutil` by sobolevn · Pull Request #98520 · python/cpython

Thank you for the reviews: @merwok and @CAM-Gerlach
It is much better now. I was not aware of ._deprecated helper.

I've also checked that get_loader does not get 2 warnings (because it is using find_loader inside):

>>> import pkgutil
>>> pkgutil.get_loader('os')
<stdin>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec instead
<_frozen_importlib_external.SourceFileLoader object at 0x1012d55f0>
>>> 

test_pkgutil tests are also clean, no unwanted warnings. I will look through all logs again when it is completed.

I've also merged one of the @CAM-Gerlach's suggestion, so you get a credit for your awesome proposals! 🤝