Strip non-semantic versioning before check

This commit is contained in:
Miguel Jacq 2025-02-03 17:12:42 +11:00
parent 17b8007514
commit 52c9544c8b
No known key found for this signature in database
GPG Key ID: 59B3F0C24135C6A9
2 changed files with 4 additions and 2 deletions

View File

@ -658,7 +658,8 @@ class Onion(object):
# Does this version of Tor support next-gen ('v3') onions? # Does this version of Tor support next-gen ('v3') onions?
# Note, this is the version of Tor where this bug was fixed: # Note, this is the version of Tor where this bug was fixed:
# https://trac.torproject.org/projects/tor/ticket/28619 # https://trac.torproject.org/projects/tor/ticket/28619
self.supports_v3_onions = Version(self.tor_version) >= Version("0.3.5.7") cleaned_tor_version = re.sub(r"\s*\(.*\)", "", self.tor_version)
self.supports_v3_onions = Version(cleaned_tor_version) >= Version("0.3.5.7")
# Now that we are connected to Tor, if we are using built-in bridges, # Now that we are connected to Tor, if we are using built-in bridges,
# update them with the latest copy available from the Tor API # update them with the latest copy available from the Tor API

View File

@ -106,7 +106,8 @@ class UpdateChecker(QtCore.QObject):
if force: if force:
path += "?force=1" path += "?force=1"
if Version(self.onion.tor_version) >= Version("0.3.2.9"): cleaned_tor_version = re.sub(r"\s*\(.*\)", "", self.onion.tor_version)
if Version(cleaned_tor_version) >= Version("0.3.2.9"):
onion_domain = ( onion_domain = (
"lldan5gahapx5k7iafb3s4ikijc4ni7gx5iywdflkba5y2ezyg6sjgyd.onion" "lldan5gahapx5k7iafb3s4ikijc4ni7gx5iywdflkba5y2ezyg6sjgyd.onion"
) )