Skip to content

Commit

Permalink
fixed py3, subprocess error output also needs to be converted to str
Browse files Browse the repository at this point in the history
  • Loading branch information
hackaugusto committed Oct 24, 2016
1 parent dc561b4 commit 2d9d619
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions autoload/vundle/installer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def sync(cmd):
import msvcrt
devnull = msvcrt.get_osfhandle(os.devnull)

# py3 output is bytes, convert it before returning

try:
out = subprocess.check_output(
cmd,
Expand All @@ -92,11 +94,10 @@ def sync(cmd):
stderr=subprocess.STDOUT,
)
except subprocess.CalledProcessError as error:
return (error.returncode, error.output)
return (error.returncode, to_str(error.output))
except Excpetion as error:
return (-1, error.message)
return (-1, to_str(error.message))

# py3 returns bytes
return (0, to_str(out))

def ui(iterable, cmds, shas, total, threads):
Expand Down

0 comments on commit 2d9d619

Please sign in to comment.