Use subprocess check_output to run git

This makes ghsync work on MS Windows. `commands` is only supported on
Unix platforms.
This commit is contained in:
Patrice Neff
2012-01-18 09:42:04 +01:00
parent ab222a47b1
commit 46838bb4dc
+9 -2
View File
@@ -23,14 +23,21 @@ Inspired by Gisty (http://github.com/swdyh/gisty).
import os
import sys
from commands import getoutput as cmd
from clint import args
from clint.textui import puts, colored, indent
import requests
import json
from github2.client import Github
try:
# check_output is new in 2.7.
from subprocess import check_output
def cmd(command):
return check_output(command, shell=True).strip()
except ImportError:
# commands is deprecated and doesn't work on Windows
from commands import getoutput as cmd
__author__ = 'Kenneth Reitz'
__license__ = 'ISC'