Skip to content

Commit c06f693

Browse files
committed
upip: expandhome(): Call uos.getenv() only if there's something to expand.
To work on baremetal targets without getenv().
1 parent f115b8c commit c06f693

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

upip/upip.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ def install_tar(f, prefix):
8989
return meta
9090

9191
def expandhome(s):
92-
h = os.getenv("HOME")
93-
s = s.replace("~/", h + "/")
92+
if "~/" in s:
93+
h = os.getenv("HOME")
94+
s = s.replace("~/", h + "/")
9495
return s
9596

9697
import ussl

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy