diff options
Diffstat (limited to 'project/utils.py')
-rw-r--r-- | project/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/project/utils.py b/project/utils.py index 68327af..5874eab 100644 --- a/project/utils.py +++ b/project/utils.py @@ -74,3 +74,9 @@ def temp_file(contents, **kwargs): file.write(contents) with delete(path): yield path + + +def env(name): + if name not in os.environ: + raise RuntimeError(f'undefined environment variable: {name}') + return os.environ[name] |