From 7df4193c595d0d4344fc77b8b3ab1f772f0efc37 Mon Sep 17 00:00:00 2001 From: Tomoatsu Shimada Date: Sat, 9 Mar 2019 07:56:51 +0900 Subject: [PATCH] Adjust python module search path to avoid picking up pre-existing pyserial/esptool instead of one under tools/ --- tools/upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/upload.py b/tools/upload.py index 5cbe647018..e6725fdf75 100755 --- a/tools/upload.py +++ b/tools/upload.py @@ -12,8 +12,8 @@ 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")