Browse Source

windows binaries: try to prevent users from renaming exe while running

closes https://github.com/spesmilo/electrum/issues/4072
(this fix AFAICT only works on Windows, and #4072 contains some macOS reports as well,
however all recent reports are for Windows and overall most reports are for Windows,
so let's close it optimistically for now)
patch-4
SomberNight 3 years ago
parent
commit
ae76a0daf5
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      run_electrum

6
run_electrum

@ -56,6 +56,12 @@ if is_git_clone:
if is_local or is_android:
sys.path.insert(0, os.path.join(script_dir, 'packages'))
if is_pyinstaller:
# Keep an open file handle for the binary that started us. On Windows, this
# prevents users from moving or renaming the exe file while running (doing which
# causes ImportErrors and other runtime failures). (see #4072)
_file = open(sys.executable, 'rb')
def check_imports():
# pure-python dependencies need to be imported here for pyinstaller

Loading…
Cancel
Save