-
Notifications
You must be signed in to change notification settings - Fork 84
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
Improve handling of "version" string from Etherscan #545
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -474,7 +474,9 @@ def _convert_version(version: str) -> str: | |
Returns: | ||
str: converted version | ||
""" | ||
return version[1 : version.find("+")] | ||
if "+" in version: | ||
return version[1 : version.find("+")] | ||
return version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do versions with no "+" also have no "v" in the beginning? With this change, versions without "+" won't have the first character removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was not really necessary (as the code worked with the |
||
|
||
|
||
def _sanitize_remappings( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
_convert_version
function now handles version strings without a+
character by returning the entire string if the+
character is not found. This change correctly addresses the issue described in the PR objectives. However, the function unnecessarily slices the version string from index 1, which could remove the first character of the version string unintentionally. This could lead to incorrect version handling if the version string does not start with 'v' or if the character is essential.Committable suggestion