Skip to content
Snippets Groups Projects
Commit 673a631c authored by Matt Harbison's avatar Matt Harbison
Browse files

thg: avoid referencing `__file__` in the main script in frozen builds

I got this when launching WorkBench on Windows (macOS seemed OK):

    Traceback (most recent call last):
      File "thg", line 16, in <module>
    NameError: name '__file__' is not defined

It looks like this broke in 326e8dde97a9, as `__file__` was avoided in forzen
builds prior to that.
parent 37160073
No related branches found
No related tags found
No related merge requests found
Pipeline #100070 passed
......@@ -13,7 +13,6 @@
import os
import sys
thg_base_path = os.path.dirname(os.path.realpath(__file__))
if hasattr(sys, "frozen"):
if sys.frozen == 'windows_exe':
......@@ -100,6 +99,8 @@
'system32', 'cmd.exe')
os.environ['COMSPEC'] = comspec
else:
thg_base_path = os.path.dirname(os.path.realpath(__file__))
testpath = os.path.join(thg_base_path, 'tortoisehg')
if os.path.isdir(testpath) and thg_base_path not in sys.path:
sys.path.insert(0, thg_base_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment