Add workaround for string.split for Python3
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
4fbb5640ac
commit
3848bc55f3
@ -161,7 +161,13 @@ def imapsplit(imapstring):
|
||||
retval.append(quoted)
|
||||
workstr = rest
|
||||
else:
|
||||
splits = None
|
||||
# Python2
|
||||
if hasattr(string, 'split'):
|
||||
splits = string.split(workstr, maxsplit = 1)
|
||||
# Python3
|
||||
else:
|
||||
splits = str.split(workstr, maxsplit = 1)
|
||||
splitslen = len(splits)
|
||||
# The unquoted word is splits[0]; the remainder is splits[1]
|
||||
if splitslen == 2:
|
||||
|
Loading…
Reference in New Issue
Block a user