Skip to content

Commit 87d8f73

Browse files
committed
Update au_act_esptool.py
1 parent d77b667 commit 87d8f73

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

RTK_Firmware_Uploader/au_act_esptool.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,29 @@
55
from platform import system
66
import os.path
77

8+
import sys
9+
810
if (system() == "Darwin"): # Fix for MacOS pyinstaller windowed executable
911

12+
if hasattr(sys, '_MEIPASS'):
13+
print ("Has _MEIPASS")
14+
1015
head_tail = os.path.split(os.path.dirname(__file__))
1116
base_path = os.path.abspath(head_tail[0])
1217
STUBS_DIR = os.path.join(base_path, "esptool", "targets", "stub_flasher")
18+
print (STUBS_DIR)
19+
print (head_tail[1])
1320
# Python hackiness: change the path to stub json files in the context of the esptool
1421
# module, so it edits the esptool's global variables
15-
exec(
16-
"loader.STUBS_DIR = '{}'".format(STUBS_DIR),
17-
esptool.__dict__,
18-
esptool.__dict__,
19-
)
22+
try:
23+
exec(
24+
"esptool.loader.STUBS_DIR = '{}'".format(STUBS_DIR),
25+
esptool.__dict__,
26+
esptool.__dict__,
27+
)
28+
except:
29+
print ("The exec failed...")
30+
pass
2031

2132
#--------------------------------------------------------------------------------------
2233
# action testing

0 commit comments

Comments
 (0)