Fix safe_shlex_split when both conditions are true
This commit is contained in:
parent
c0ed2f52e6
commit
ee1961cb42
@ -64,6 +64,7 @@ def safe_shlex_split(s):
|
|||||||
Since shlex raises ValueError in both cases we unfortunately
|
Since shlex raises ValueError in both cases we unfortunately
|
||||||
have to parse the exception string...
|
have to parse the exception string...
|
||||||
"""
|
"""
|
||||||
|
while True:
|
||||||
try:
|
try:
|
||||||
return shlex.split(s)
|
return shlex.split(s)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
@ -77,7 +78,6 @@ def safe_shlex_split(s):
|
|||||||
s += '\\'
|
s += '\\'
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
return shlex.split(s)
|
|
||||||
|
|
||||||
|
|
||||||
def shell_escape(s):
|
def shell_escape(s):
|
||||||
|
Loading…
Reference in New Issue
Block a user