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

Code Update apply_versions.py #995

Merged
merged 2 commits into from May 2, 2023
Merged

Conversation

rumplin
Copy link
Contributor

@rumplin rumplin commented May 2, 2023

os.path.join to join file paths, which is a more robust and platform-independent way to join paths than concatenating strings.

The updated error message is more robust. The original error message did not convert the exception object to a string, so if the exception object did not have a str method defined (which is unlikely but possible), the code would have crashed with a TypeError. By calling str(e), we ensure that we always have a string representation of the error, even if the exception object is not a standard Python exception.

Added checking if file is missing.

os.path.join to join file paths, which is a more robust and platform-independent way to join paths than concatenating strings.
The updated error message is more robust. The original error message did not convert the exception object to a string, so if the exception object did not have a __str__ method defined (which is unlikely but possible), the code would have crashed with a TypeError. By calling str(e), we ensure that we always have a string representation of the error, even if the exception object is not a standard Python exception.
Added checking if file is missing
@marticliment marticliment merged commit 3bc5372 into marticliment:main May 2, 2023
@rumplin rumplin deleted the patch-2 branch May 2, 2023 20:16
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.

None yet

2 participants