From cce59d79576bcfc2c44f2ca4c3c6be2b82f2dd36 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 23 Oct 2016 16:55:16 -0700 Subject: [PATCH] shlex.split works in py27+ --- pre_commit/parse_shebang.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pre_commit/parse_shebang.py b/pre_commit/parse_shebang.py index a243a826..438e72ef 100644 --- a/pre_commit/parse_shebang.py +++ b/pre_commit/parse_shebang.py @@ -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