aboutsummaryrefslogtreecommitdiff
path: root/pw_cli/py/pw_cli/envparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'pw_cli/py/pw_cli/envparse.py')
-rw-r--r--pw_cli/py/pw_cli/envparse.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pw_cli/py/pw_cli/envparse.py b/pw_cli/py/pw_cli/envparse.py
index d9ed9de47..182936f2d 100644
--- a/pw_cli/py/pw_cli/envparse.py
+++ b/pw_cli/py/pw_cli/envparse.py
@@ -22,6 +22,7 @@ from typing import (
Generic,
IO,
List,
+ Literal,
Mapping,
Optional,
TypeVar,
@@ -173,7 +174,10 @@ class EnvironmentParser:
and var not in self._variables
and not var.endswith(allowed_suffixes)
):
- raise ValueError(f'Unrecognized environment variable {var}')
+ raise ValueError(
+ f'Unrecognized environment variable {var}, please '
+ 'remove it from your environment'
+ )
return namespace
@@ -202,9 +206,7 @@ def strict_bool(value: str) -> bool:
)
-# TODO(mohrr) Switch to Literal when no longer supporting Python 3.7.
-# OpenMode = Literal['r', 'rb', 'w', 'wb']
-OpenMode = str
+OpenMode = Literal['r', 'rb', 'w', 'wb']
class FileType: