summaryrefslogtreecommitdiff
path: root/src/tox/config/cli
diff options
context:
space:
mode:
Diffstat (limited to 'src/tox/config/cli')
-rw-r--r--src/tox/config/cli/parse.py5
-rw-r--r--src/tox/config/cli/parser.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/tox/config/cli/parse.py b/src/tox/config/cli/parse.py
index 63bd6826..73a332d9 100644
--- a/src/tox/config/cli/parse.py
+++ b/src/tox/config/cli/parse.py
@@ -16,10 +16,11 @@ def get_options(*args: str) -> Tuple[Parsed, Handlers, Optional[Sequence[str]],
pos_args: Optional[Tuple[str, ...]] = None
try: # remove positional arguments passed to parser if specified, they are pulled directly from sys.argv
pos_arg_at = args.index("--")
- pos_args = tuple(args[pos_arg_at + 1 :])
- args = args[:pos_arg_at]
except ValueError:
pass
+ else:
+ pos_args = tuple(args[pos_arg_at + 1 :])
+ args = args[:pos_arg_at]
guess_verbosity, log_handler, source = _get_base(args)
parsed, cmd_handlers = _get_all(args)
diff --git a/src/tox/config/cli/parser.py b/src/tox/config/cli/parser.py
index ac27cac9..df8d6163 100644
--- a/src/tox/config/cli/parser.py
+++ b/src/tox/config/cli/parser.py
@@ -182,7 +182,7 @@ class ToxParser(ArgumentParserWithEnvAndConfig):
def add_argument(self, *args: str, of_type: Optional[Type[Any]] = None, **kwargs: Any) -> Action:
result = super().add_argument(*args, **kwargs)
- if self.of_cmd is None and (result.dest not in ("help",)):
+ if self.of_cmd is None and result.dest != "help":
self._arguments.append((args, of_type, kwargs))
if hasattr(self, "_cmd") and self._cmd is not None and hasattr(self._cmd, "choices"):
for parser in {id(v): v for k, v in self._cmd.choices.items()}.values():