Skip to content

Commit 192aaa4

Browse files
shimarinearlephilhower
authored andcommitted
Adjust python module search path to avoid picking up pre-existing pyserial/esptool instead of one under tools/ (#5854)
1 parent aa8d348 commit 192aaa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/upload.py

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

0 commit comments

Comments
 (0)