Skip to content

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

@shoaibnigamshaik

Description

@shoaibnigamshaik

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 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions