In CLI get_tor_path, stop trying to look in resources first

This commit is contained in:
Micah Lee 2021-10-24 17:35:24 -07:00
parent 7cd1a53d00
commit c3eeaefb9f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -309,22 +309,6 @@ class Common:
def get_tor_paths(self): def get_tor_paths(self):
if self.platform == "Linux": if self.platform == "Linux":
# Look in resources first
base_path = self.get_resource_path("tor")
if os.path.exists(base_path):
self.log(
"Common", "get_tor_paths", f"using tor binaries in {base_path}"
)
tor_path = os.path.join(base_path, "tor")
tor_geo_ip_file_path = os.path.join(base_path, "geoip")
tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
snowflake_file_path = os.path.join(base_path, "snowflake-client")
else:
# Fallback to looking in the path
self.log(
"Common", "get_tor_paths", f"using tor binaries in system path"
)
tor_path = shutil.which("tor") tor_path = shutil.which("tor")
if not tor_path: if not tor_path:
raise CannotFindTor() raise CannotFindTor()
@ -341,16 +325,6 @@ class Common:
tor_geo_ip_file_path = os.path.join(base_path, "Data", "Tor", "geoip") tor_geo_ip_file_path = os.path.join(base_path, "Data", "Tor", "geoip")
tor_geo_ipv6_file_path = os.path.join(base_path, "Data", "Tor", "geoip6") tor_geo_ipv6_file_path = os.path.join(base_path, "Data", "Tor", "geoip6")
elif self.platform == "Darwin": elif self.platform == "Darwin":
# Look in resources first
base_path = self.get_resource_path("tor")
if os.path.exists(base_path):
tor_path = os.path.join(base_path, "tor")
tor_geo_ip_file_path = os.path.join(base_path, "geoip")
tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
snowflake_file_path = os.path.join(base_path, "snowflake-client")
else:
# Fallback to looking in the path
tor_path = shutil.which("tor") tor_path = shutil.which("tor")
if not tor_path: if not tor_path:
raise CannotFindTor() raise CannotFindTor()