Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Handle no valid python files in the directory. #83

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

zleman1593
Copy link
Contributor

@zleman1593 zleman1593 commented Nov 11, 2024

If you run torchfix script on a directory without Python files, it will terminate with an error. This modifies the script to just do nothing in such cases, without terminating with an error.

Testing:

Added test "test_no_python_files"

Without fix the new test fails:

assert 1 == 0
...... raise Exception("Must have at least one job to process!")\nException: Must have at least one job to process!\n').returncode ......

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 11, 2024
@zleman1593 zleman1593 changed the title Return without an error when there are no valid python files in the directory. Handle no valid python files in the directory. Nov 11, 2024
@zleman1593 zleman1593 marked this pull request as ready for review November 11, 2024 20:43
@zleman1593 zleman1593 changed the title Handle no valid python files in the directory. Fix: Handle no valid python files in the directory. Nov 11, 2024
torchfix/__main__.py Outdated Show resolved Hide resolved
@kit1980 kit1980 merged commit 6bfffd9 into main Nov 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants