py-htgettoken: use os.environ, avoid AttributeError (#41717)
* py-htgettoken: use os.environ, avoid AttributeError This avoids the following error: ``` Warning: could not load runtime environment due to AttributeError: 'EnvironmentModifications' object has no attribute 'get' ``` * py-htgettoken: allow for undefined variables * py-htgettoken: use dict get() Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> --------- Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
17d47accf9
commit
b111064e22
@ -33,8 +33,8 @@ class PyHtgettoken(PythonPackage):
|
||||
depends_on("py-urllib3", type=("build", "run"))
|
||||
|
||||
def setup_run_environment(self, env):
|
||||
dir = env.get("XDG_RUNTIME_DIR") or "/tmp"
|
||||
uid = env.get("UID") or os.geteuid()
|
||||
dir = os.environ.get("XDG_RUNTIME_DIR", "/tmp")
|
||||
uid = os.environ.get("UID", str(os.geteuid()))
|
||||
file = join_path(dir, "bt_u" + uid)
|
||||
env.set("BEARER_TOKEN", file)
|
||||
env.set("BEARER_TOKEN_FILE", file)
|
||||
|
Loading…
Reference in New Issue
Block a user