Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57e830d

Browse files
committed
remove dead code
1 parent 8f7b6b3 commit 57e830d

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

IPython/utils/_process_common.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,6 @@ def arg_split(s, posix=False, strict=True):
187187
command-line args.
188188
"""
189189

190-
# Unfortunately, python's shlex module is buggy with unicode input:
191-
# http://bugs.python.org/issue1170
192-
# At least encoding the input when it's unicode seems to help, but there
193-
# may be more problems lurking. Apparently this is fixed in python3.
194-
is_unicode = False
195-
if (not py3compat.PY3) and isinstance(s, unicode):
196-
is_unicode = True
197-
s = s.encode('utf-8')
198190
lex = shlex.shlex(s, posix=posix)
199191
lex.whitespace_split = True
200192
# Extract tokens, ensuring that things like leaving open quotes
@@ -216,8 +208,5 @@ def arg_split(s, posix=False, strict=True):
216208
# couldn't parse, get remaining blob as last token
217209
tokens.append(lex.token)
218210
break
219-
220-
if is_unicode:
221-
# Convert the tokens back to unicode.
222-
tokens = [x.decode('utf-8') for x in tokens]
211+
223212
return tokens

0 commit comments

Comments
 (0)