Skip to content

Commit

Permalink
Merge pull request #126 from brettc/buffer2
Browse files Browse the repository at this point in the history
Buffer2
  • Loading branch information
roblanf authored Jun 5, 2017
2 parents 4722360 + c92c486 commit cbd4eb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion partfinder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ def main(name, datatype, passed_args=None):
log.error("""A program that Partitionfinder uses failed. Output
follows, in case it's helpful for finding the problem""")
log.error("%s", e.stdout)
log.error("%s", e.stderr)
if options.show_python_exceptions or passed_args is not None:
raise

Expand Down
14 changes: 7 additions & 7 deletions partfinder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class PartitionFinderError(Exception):
pass

class ExternalProgramError(PartitionFinderError):
def __init__(self, stderr, stdout):
self.stderr = stderr
def __init__(self, stdout, stderr):
self.stdout = stdout
self.stderr = stderr

class ParseError(PartitionFinderError):
pass
Expand Down Expand Up @@ -74,13 +74,13 @@ def run_program(binary, command):
shlex.split(command),
shell=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stderr=subprocess.STDOUT)

# Capture the output, we might put it into the errors
stdout, stderr = p.communicate()
# p.terminate()
err = p.wait()

if p.returncode != 0:
if err:
# Capture the output to put into the error
stdout, stderr = p.communicate()
raise ExternalProgramError(stdout, stderr)

def dupfile(src, dst):
Expand Down

0 comments on commit cbd4eb1

Please sign in to comment.