Skip to content

Conversation

@sondt99
Copy link

@sondt99 sondt99 commented Aug 20, 2025

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 avoid SyntaxWarning: invalid escape sequence.
  • option.py
    • Replaced deprecated imp module with importlib / SourceFileLoader for Python 3.12 compatibility.
    • Removed unused imports (ipaddress, IPy, importlib.util).
    • Cleaned up error handling and simplified target parsing logic.

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 -h and confirmed the CLI works without warnings or import errors.

… imports

- Replaced imp with importlib/SourceFileLoader for Python 3.12 compatibility
- Removed unused imports (ipaddress, IPy, importlib.util)
- Simplified error handling for target parsing
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

Successfully merging this pull request may close these issues.

1 participant