safe_shlex_split: Adjust docstring

This commit is contained in:
Florian Bruhin 2014-09-18 16:15:57 +02:00
parent 6a86924e60
commit 7de0b85dda

View File

@ -102,7 +102,7 @@ def safe_shlex_split(s):
r"""Split a string via shlex safely (don't bail out on unbalanced quotes). r"""Split a string via shlex safely (don't bail out on unbalanced quotes).
We split while the user is typing (for completion), and as We split while the user is typing (for completion), and as
soon as " or \ is typed, the string is invalid for shlex, soon as ", ' or \ is typed, the string is invalid for shlex,
because it encounters EOF while in quote/escape state. because it encounters EOF while in quote/escape state.
Here we fix this error temporarely so shlex doesn't blow up, Here we fix this error temporarely so shlex doesn't blow up,
@ -110,6 +110,8 @@ 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...
We try 3 times so multiple errors can be fixed.
""" """
if s is None: if s is None:
raise TypeError("Can't split None!") raise TypeError("Can't split None!")