summaryrefslogtreecommitdiff
path: root/argparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'argparse.py')
-rw-r--r--argparse.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/argparse.py b/argparse.py
index bf3f277..05dbffb 100644
--- a/argparse.py
+++ b/argparse.py
@@ -1937,10 +1937,6 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
if not arg_string:
return None
- # if it contains a space, it was meant to be a positional
- if ' ' in arg_string:
- return None
-
# if it doesn't start with a prefix, it was meant to be positional
if not arg_string[0] in self.prefix_chars:
return None
@@ -1978,6 +1974,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
if not self._has_negative_number_optionals:
return None
+ # if it contains a space, it was meant to be a positional
+ if ' ' in arg_string:
+ return None
+
# it was meant to be an optional but there is no such option
# in this parser (though it might be a valid option in a subparser)
return None, arg_string, None