Skip to content

Commit

Permalink
Skip first sys.argv on frozen environment
Browse files Browse the repository at this point in the history
  • Loading branch information
xoriole committed Feb 4, 2022
1 parent 7a319b1 commit ec567f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tribler-gui/tribler_gui/core_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ def start_tribler_core(self):

core_args = self.core_args
if not core_args:
core_args = sys.argv + ['--core']
# If the core is running on frozen environment, sys.argv[0] becomes tribler executable while
# running from source code, sys.argv[0] is run_tribler.py which is run by python runtime.
# So, we skip the first argument to prevent argument parsing error on frozen environment.
sys_argv = sys.argv if not hasattr(sys, '_MEIPASS') else sys.argv[1:] if len(sys.argv) > 1 else []
core_args = sys_argv + ['--core']

self.core_process = QProcess()
self.core_process.setProcessEnvironment(core_env)
Expand Down

0 comments on commit ec567f6

Please sign in to comment.