Deprecated stdlib module imported
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
imp is deprecated since Python 3.4 and distutils is deprecated since 3.10 and removed entirely in 3.12; both break on a newer interpreter.
Why it matters
The imp module has been deprecated since Python 3.4 in favor of importlib, and distutils is deprecated as of Python 3.10 and was removed entirely in Python 3.12, so code importing either one emits deprecation warnings today and stops working outright on a newer interpreter. Because these modules are often imported deep in build scripts or setup.py-adjacent code, the breakage tends to surface late, during a Python version upgrade, rather than during normal development.
How to fix it
Replace imp with the equivalent importlib APIs (importlib.import_module, importlib.util.spec_from_file_location, and related functions). Replace distutils usage with setuptools, which still ships most of the same functionality, or the specific stdlib or third-party replacement for what you need, such as shutil for distutils.spawn or packaging for version parsing.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo