python-cs50 icon indicating copy to clipboard operation
python-cs50 copied to clipboard

Deprecated use of pkgutil.get_loader in flask.py

Open shoaibnigamshaik opened this issue 10 months ago • 0 comments

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 🚀

shoaibnigamshaik avatar Apr 11 '25 08:04 shoaibnigamshaik