Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use subprocess `check_output` to run git #7

Merged
merged 1 commit into from

2 participants

@pneff

This makes ghsync work on MS Windows. commands is only supported on Unix platforms.

@pneff pneff Use subprocess `check_output` to run git
This makes ghsync work on MS Windows. `commands` is only supported on
Unix platforms.
46838bb
@kennethreitz

Seriously? Heh, I had no idea.

@kennethreitz

Thanks!

@kennethreitz kennethreitz merged commit 74fc434 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 18, 2012
  1. @pneff

    Use subprocess `check_output` to run git

    pneff authored
    This makes ghsync work on MS Windows. `commands` is only supported on
    Unix platforms.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 ghsync/core.py
View
11 ghsync/core.py
@@ -23,14 +23,21 @@
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'
Something went wrong with that request. Please try again.