Fix safe_shlex_split when both conditions are true

This commit is contained in:
Florian Bruhin 2014-05-05 12:06:44 +02:00
parent c0ed2f52e6
commit ee1961cb42

View File

@ -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):