From c06f693ac3f8400e2822f84fb5b77cc2efbaaa5e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 8 Oct 2016 00:36:24 +0300 Subject: [PATCH] upip: expandhome(): Call uos.getenv() only if there's something to expand. To work on baremetal targets without getenv(). --- upip/upip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/upip/upip.py b/upip/upip.py index 13b0ad2a..50de6c3a 100644 --- a/upip/upip.py +++ b/upip/upip.py @@ -89,8 +89,9 @@ def install_tar(f, prefix): return meta def expandhome(s): - h = os.getenv("HOME") - s = s.replace("~/", h + "/") + if "~/" in s: + h = os.getenv("HOME") + s = s.replace("~/", h + "/") return s import ussl