Skip to content

Conversation

@vo0ov
Copy link

@vo0ov vo0ov commented Jan 9, 2026

This pull request updates the project's Python compatibility and modernizes some internal code to improve reliability and future-proofing. The most important changes are grouped below:

Python Version Updates:

  • Updated the test workflow in .github/workflows/test.yml to use Python 3.12 as the latest version and removed the deprecated 3.12-dev entry from the matrix. Also added workflow_dispatch as a trigger for manual workflow runs.
  • Added Python 3.12 to the tox.ini environment list, ensuring local and CI testing covers the latest Python release.

Code Modernization and Reliability:

  • Replaced the deprecated distutils.spawn.find_executable with shutil.which in thefuck/system/unix.py for checking executable presence, and updated the open_command function to use which. [1] [2]
  • Improved error handling in thefuck/conf.py for dynamic module loading: now raises ImportError if the spec or loader is missing, and registers the loaded module in sys.modules for better compatibility. Also broadened the exception handling to catch all exceptions, falling back to the legacy loader only if necessary.

vo0ov added 3 commits January 9, 2026 21:31
Add Python 3.12 support to CI and test configs

Updates the test workflow and environment matrix to include Python 3.12,
enabling CI runs and local testing for the latest stable Python version.
Also improves robustness of dynamic module loading logic.
Switches from the deprecated distutils.spawn.find_executable to shutil.which for locating executables, ensuring better compatibility and future-proofing the code.
Copy link
Author

@vo0ov vo0ov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works.

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