mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix so 'split_quoted()' handles any whitespace delimiter (not just space).
This commit is contained in:
parent
e5034378cc
commit
2b042ded19
1 changed files with 2 additions and 2 deletions
|
@ -139,7 +139,7 @@ def grok_environment_error (exc, prefix="error: "):
|
|||
|
||||
|
||||
# Needed by 'split_quoted()'
|
||||
_wordchars_re = re.compile(r'[^\\\'\"\ ]*')
|
||||
_wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace)
|
||||
_squote_re = re.compile(r"'(?:[^'\\]|\\.)*'")
|
||||
_dquote_re = re.compile(r'"(?:[^"\\]|\\.)*"')
|
||||
|
||||
|
@ -169,7 +169,7 @@ def split_quoted (s):
|
|||
words.append(s[:end])
|
||||
break
|
||||
|
||||
if s[end] == ' ': # unescaped, unquoted space: now
|
||||
if s[end] in string.whitespace: # unescaped, unquoted whitespace: now
|
||||
words.append(s[:end]) # we definitely have a word delimiter
|
||||
s = string.lstrip(s[end:])
|
||||
pos = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue