megies  committed 69219b9

revert checking for string and just pass a string to run() instead of a list

  • Participants
  • Parent commits b847d4e

Comments (0)

Files changed (1)

File flake8/

         for file_ in files_modified:
             # get the staged version of the file
-            gitcmd_getstaged = ["git", "show", ":%s" % file_]
+            gitcmd_getstaged = "git show :%s" % file_
             _, out, _ = run(gitcmd_getstaged, raw_output=True, decode=False)
             # write the staged version to temp dir with its full path to
             # avoid overwriting files with the same name
 def run(command, raw_output=False, decode=True):
-    if isinstance(command, basestring):
-        command = command.split()
-    p = Popen(command, stdout=PIPE, stderr=PIPE)
+    p = Popen(command.split(), stdout=PIPE, stderr=PIPE)
     (stdout, stderr) = p.communicate()
     # On python 3, subprocess.Popen returns bytes objects which expect
     # endswith to be given a bytes object or a tuple of bytes but not native