Skip to content

Deprecated use of pkgutil.get_loader in flask.py #192

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

Open
Shoaib-Programmer opened this issue Apr 11, 2025 · 0 comments
Open

Deprecated use of pkgutil.get_loader in flask.py #192

Shoaib-Programmer opened this issue Apr 11, 2025 · 0 comments

Comments

@Shoaib-Programmer
Copy link

Hi CS50 team! 👋

While running pytest on of my projects, I encountered this warning:

DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14
This warning comes from src/flask.py, which still uses pkgutil.get_loader("flask"). To future-proof the library for Python 3.14+, I replaced it with importlib.util.find_spec("flask"). (The former will get deprecated!)

In the same PR, I also made other refactors, such as:

  • Removed unused imports

  • Replaced broad except: with except Exception: for better practice

The PR is available here: #XYZ

Would love for someone to take a look.

Thanks,
Shoaib 🚀

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

No branches or pull requests

1 participant