Skip to content

Commit

Permalink
Updated default dll import path to be '.'
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Jun 14, 2024
1 parent 2cb4280 commit fb1fd7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions run_all_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ def install_libsodium() -> None:
# Ensure a libsodium.zip
if not pathlib.Path("libsodium.zip").exists():
import json
import urllib.request as request
from urllib import request
response = request.urlopen("https://api.github.com/repos/jedisct1/libsodium/releases")
release = json.loads(response.read())[0]
response.close()
asset = [asset for asset in release['assets'] if asset['name'].endswith("-msvc.zip")][0]
pathlib.Path("libsodium.zip").write_bytes(request.urlopen(asset['browser_download_url']).read())
asset = next(asset for asset in release['assets'] if asset['name'].endswith("-msvc.zip"))
pathlib.Path("libsodium.zip").write_bytes(request.urlopen(asset['browser_download_url']).read()) # noqa: S310

# Unpack just the libsodium.dll
if not pathlib.Path("libsodium.dll").exists():
Expand All @@ -285,7 +285,7 @@ def windows_missing_libsodium() -> bool:
return False

# Try to find it in the local directory. This is where we'll download it anyway.
os.add_dll_directory(os.path.dirname(__file__) or os.path.abspath('.'))
os.add_dll_directory(os.path.abspath('.'))
try:
import libnacl # noqa: F401
return False
Expand Down

0 comments on commit fb1fd7e

Please sign in to comment.