Skip to content

Commit 8be3000

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

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

RTK_Firmware_Uploader/au_act_esptool.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@
77

88
import sys
99

10-
if (system() == "Darwin"): # Fix for MacOS pyinstaller windowed executable
11-
12-
if hasattr(sys, '_MEIPASS'):
13-
print ("Has _MEIPASS")
10+
if (system() == "Darwin") and hasattr(sys, '_MEIPASS'): # Fix for MacOS pyinstaller windowed executable
1411

1512
head_tail = os.path.split(os.path.dirname(__file__))
1613
base_path = os.path.abspath(head_tail[0])
1714
STUBS_DIR = os.path.join(base_path, "esptool", "targets", "stub_flasher")
1815
print (STUBS_DIR)
19-
print (head_tail[1])
2016
# Python hackiness: change the path to stub json files in the context of the esptool
2117
# module, so it edits the esptool's global variables
18+
result = ''
2219
try:
23-
exec(
24-
"esptool.loader.STUBS_DIR = '{}'".format(STUBS_DIR),
20+
result = str(exec(
21+
"loader.STUBS_DIR = '{}'".format(STUBS_DIR),
2522
esptool.__dict__,
2623
esptool.__dict__,
27-
)
24+
))
2825
except:
29-
print ("The exec failed...")
26+
print ("The exec failed:", result)
3027
pass
3128

3229
#--------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)