shlex.split works in py27+

This commit is contained in:
Anthony Sottile
2016-10-23 16:55:16 -07:00
parent 3b888c9e42
commit cce59d7957

View File

@@ -6,8 +6,6 @@ import os.path
import shlex
import string
from pre_commit import five
printable = frozenset(string.printable)
@@ -31,8 +29,7 @@ def parse_bytesio(bytesio):
if c not in printable:
return ()
# shlex.split is horribly broken in py26 on text strings
cmd = tuple(shlex.split(five.n(first_line)))
cmd = tuple(shlex.split(first_line))
if cmd[0] == '/usr/bin/env':
cmd = cmd[1:]
return cmd