Skip to content

Commit

Permalink
Fix runtime error when updating Package Control
Browse files Browse the repository at this point in the history
Fixes #1649

This commit silently ignores RuntimeErrors raised by `use_openssl()`,
if oscrypto has already been imported before. That's the case if modules are
reloaded after Package Control update.
  • Loading branch information
deathaxe committed Jul 26, 2023
1 parent 00cde34 commit a7770f6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions package_control/downloaders/oscrypto_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
'sublime_text' in sys.executable or
'plugin_host' in sys.executable):
install_dir = os.path.dirname(sys.executable)
use_openssl(
os.path.join(install_dir, 'libcrypto.so.1.1'),
os.path.join(install_dir, 'libssl.so.1.1')
)
try:
use_openssl(
os.path.join(install_dir, 'libcrypto.so.1.1'),
os.path.join(install_dir, 'libssl.so.1.1')
)
except RuntimeError:
pass # runtime error may be raised, when reloading modules.

from ..deps.oscrypto import tls # noqa
from ..deps.oscrypto import errors as oscrypto_errors # noqa
Expand Down

0 comments on commit a7770f6

Please sign in to comment.