1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

Adjust python module search path to avoid picking up pre-existing pyserial/esptool instead of one under tools/ (#5854)

This commit is contained in:
Tomoatsu Shimada
2019-03-10 02:35:30 +09:00
committed by Earle F. Philhower, III
parent aa8d3482d3
commit 192aaa4291

View File

@ -12,8 +12,8 @@ import os
sys.argv.pop(0) # Remove executable name
toolspath = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/') # CWD in UNIX format
try:
sys.path.append(toolspath + "/pyserial") # Add pyserial dir to search path
sys.path.append(toolspath + "/esptool") # Add esptool dir to search path
sys.path.insert(0, toolspath + "/pyserial") # Add pyserial dir to search path
sys.path.insert(0, toolspath + "/esptool") # Add esptool dir to search path
import esptool # If this fails, we can't continue and will bomb below
except:
sys.stderr.write("Error in command line, need pyserial path as 1st arg and esptool path as 2nd.\n")