From 7bfa909c0090248ea70b4185288275eb58ddaff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Wed, 10 Feb 2021 02:34:57 +0000 Subject: [PATCH] Raise error when no cwd is set. --- ognibuild/session/schroot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ognibuild/session/schroot.py b/ognibuild/session/schroot.py index ac979b4..1b1b645 100644 --- a/ognibuild/session/schroot.py +++ b/ognibuild/session/schroot.py @@ -153,6 +153,8 @@ class SchrootSession(Session): self.check_call(["chown", user, home], cwd="/", user="root") def _fullpath(self, path: str) -> str: + if self._cwd is None: + raise ValueError('no cwd set') return os.path.join(self.location, os.path.join(self._cwd, path).lstrip("/")) def exists(self, path: str) -> bool: