mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
Merge pull request #421 from pre-commit/py26_cleanup
shlex.split works in py27+
This commit is contained in:
commit
8bcf24e5d5
1 changed files with 1 additions and 4 deletions
|
|
@ -6,8 +6,6 @@ import os.path
|
||||||
import shlex
|
import shlex
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from pre_commit import five
|
|
||||||
|
|
||||||
|
|
||||||
printable = frozenset(string.printable)
|
printable = frozenset(string.printable)
|
||||||
|
|
||||||
|
|
@ -31,8 +29,7 @@ def parse_bytesio(bytesio):
|
||||||
if c not in printable:
|
if c not in printable:
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
# shlex.split is horribly broken in py26 on text strings
|
cmd = tuple(shlex.split(first_line))
|
||||||
cmd = tuple(shlex.split(five.n(first_line)))
|
|
||||||
if cmd[0] == '/usr/bin/env':
|
if cmd[0] == '/usr/bin/env':
|
||||||
cmd = cmd[1:]
|
cmd = cmd[1:]
|
||||||
return cmd
|
return cmd
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue