Skip to content

Commit

Permalink
Merge pull request #20 from dotty/master
Browse files Browse the repository at this point in the history
Brought check_output into geturl and deleted check_output to ease deployment
  • Loading branch information
uams committed Jan 22, 2013
2 parents 874385b + 02505f9 commit 172ed32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
22 changes: 0 additions & 22 deletions check_output.py

This file was deleted.

17 changes: 15 additions & 2 deletions geturl
Expand Up @@ -2,9 +2,22 @@

from subprocess import CalledProcessError
try:
from subprocess import check_output
from subprocess import check_output
except ImportError:
from check_output import check_output
import subprocess

def check_output(*popenargs, **kwargs):
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
error = subprocess.CalledProcessError(retcode, cmd)
error.output = output
raise error
return output

import urllib
import json
Expand Down

0 comments on commit 172ed32

Please sign in to comment.