Browse Source

"--portable": make behaviour independent of pyinstaller version

pyinstaller 4.3 changed the value of `__file__`.
This change makes our behaviour independent of that pyinstaller change
(we always behave like old versions of pyinstaller).

fixes https://github.com/spesmilo/electrum/issues/7729
regression was introduced by b5951adc29
patch-4
SomberNight 3 years ago
parent
commit
5b500f08ea
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 8
      run_electrum

8
run_electrum

@ -331,14 +331,18 @@ def main():
if config_options.get('server'):
config_options['auto_connect'] = False
config_options['cwd'] = os.getcwd()
config_options['cwd'] = cwd = os.getcwd()
# fixme: this can probably be achieved with a runtime hook (pyinstaller)
if is_pyinstaller and os.path.exists(os.path.join(sys._MEIPASS, 'is_portable')):
config_options['portable'] = True
if config_options.get('portable'):
config_options['electrum_path'] = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'electrum_data')
if is_pyinstaller:
datadir = os.path.join(os.path.realpath(cwd), 'electrum_data')
else:
datadir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'electrum_data')
config_options['electrum_path'] = datadir
if not config_options.get('verbosity'):
warnings.simplefilter('ignore', DeprecationWarning)

Loading…
Cancel
Save