dirmap
dirmap copied to clipboard
fix: Python 3.12 compatibility and regex warning cleanup
Summary
This PR fixes compatibility issues with Python 3.12 and resolves warnings when running dirmap.
Changes
- common.py
- Converted regex patterns to use raw strings (
r"...") to avoidSyntaxWarning: invalid escape sequence.
- Converted regex patterns to use raw strings (
- option.py
- Replaced deprecated
impmodule withimportlib/SourceFileLoaderfor Python 3.12 compatibility. - Removed unused imports (
ipaddress,IPy,importlib.util). - Cleaned up error handling and simplified target parsing logic.
- Replaced deprecated
Motivation
- Ensure dirmap runs on Python ≥3.12 without errors.
- Improve code maintainability by removing obsolete and unused code.
Testing
- Verified on Python 3.12.
- Ran
python3 dirmap.py -hand confirmed the CLI works without warnings or import errors.
fix something that you can run in new python version