8000 tools/upip: Skip empty entries when looking for install path. · micropython/micropython@57bd653 · GitHub
[go: up one dir, main page]

Skip to content

Commit 57bd653

Browse files
committed
tools/upip: Skip empty entries when looking for install path.
1 parent ee49ae8 commit 57bd653

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/upip.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,12 @@ def install(to_install, install_path=None):
256256
def get_install_path():
257257
global install_path
258258
if install_path is None:
259-
# sys.path[0] is current module's path
260-
install_path = sys.path[1]
259+
# sys.path[0] is current module's path, only use if no other suitable path exists
260+
install_path = sys.path[0]
261+
for path in sys.path[1:]:
262+
if path:
263+
install_path = path
264+
break
261265
install_path = expandhome(install_path)
262266
return install_path
263267

0 commit comments

Comments
 (0)
0