Skip to content

Commit

Permalink
Stop assuming PATH env is defined when extra_paths is set
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Oct 20, 2024
1 parent 45b06fe commit be0b234
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions systemdspawner/systemdspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,11 @@ async def start(self):
properties["PrivateDevices"] = "yes"

if self.extra_paths:
env["PATH"] = "{extrapath}:{curpath}".format(
curpath=env["PATH"],
extrapath=":".join(
[self._expand_user_vars(p) for p in self.extra_paths]
),
)
new_path_list = [self._expand_user_vars(p) for p in self.extra_paths]
current_path = env.get("PATH")
if current_path:
new_path_list.append(current_path)
env["PATH"] = ":".join(new_path_list)

env["SHELL"] = self.default_shell

Expand Down

0 comments on commit be0b234

Please sign in to comment.