feat(py3): Cleanup redundant string cast

I confirmed that `add_version(...)` itself calls `str(...)` on the argument that
`things_version` is passed in to under both the Python 2.7 and Python 3.6 version of the
library so this is unnecessary here.

This results in an empty diff in py3 tests output.
This commit is contained in:
Ross Patterson 2020-09-30 09:56:43 -07:00
parent 3f297bf0e3
commit 447881a0e0
2 changed files with 2 additions and 1 deletions

1
newsfragments/3455.minor Normal file
View File

@ -0,0 +1 @@
Cleanup casting to string for better Python 3 compatibility.

View File

@ -70,7 +70,7 @@ def _common_valid_config():
# Add our application versions to the data that Foolscap's LogPublisher # Add our application versions to the data that Foolscap's LogPublisher
# reports. # reports.
for thing, things_version in get_package_versions().items(): for thing, things_version in get_package_versions().items():
app_versions.add_version(thing, str(things_version)) app_versions.add_version(thing, things_version)
# group 1 will be addr (dotted quad string), group 3 if any will be portnum (string) # group 1 will be addr (dotted quad string), group 3 if any will be portnum (string)
ADDR_RE = re.compile("^([1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*)(:([1-9][0-9]*))?$") ADDR_RE = re.compile("^([1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*)(:([1-9][0-9]*))?$")