diff --git a/systemdspawner/systemdspawner.py b/systemdspawner/systemdspawner.py index 06b3c72..e12491a 100644 --- a/systemdspawner/systemdspawner.py +++ b/systemdspawner/systemdspawner.py @@ -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_or_default_path = env.get("PATH", os.defpath) + if current_or_default_path: + new_path_list.append(current_or_default_path) + env["PATH"] = ":".join(new_path_list) env["SHELL"] = self.default_shell