From 1c12401d70b92dcbbe034c8b0c81ab276525e728 Mon Sep 17 00:00:00 2001 From: Andrea Arteaga Date: Fri, 30 Mar 2012 09:53:21 +0200 Subject: Added exception handling for starting BTL. Solved portage exception handling. --- numbench/utils/btl.py | 12 +++++++++--- numbench/utils/portageutils.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/numbench/utils/btl.py b/numbench/utils/btl.py index d464d38..c081ef4 100644 --- a/numbench/utils/btl.py +++ b/numbench/utils/btl.py @@ -187,9 +187,15 @@ def runTest(test, btlconfig): logfs.flush() # Open pipe - proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE, \ - env=runenv, cwd=btlconfig['testdir']) - benchchildren.append(proc) + try: + proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE, \ + env=runenv, cwd=btlconfig['testdir']) + benchchildren.append(proc) + except OSError: + Print('Execution failed to start') + Print('Command line: ' + ' '.join(args)) + return -1, None + result = {} diff --git a/numbench/utils/portageutils.py b/numbench/utils/portageutils.py index f58bb2b..6fa864a 100644 --- a/numbench/utils/portageutils.py +++ b/numbench/utils/portageutils.py @@ -158,7 +158,7 @@ def installPackage(test, package=None, env=None, logfile=None): if p.returncode != 0: # In case of error, print the whole emerge command - raise InstallException(p, ' '.join(cmd), logfile) + raise InstallException(pkg, ' '.join(cmd), logfile) fout.write('\n\n' + 80*'#' + '\n\n') -- cgit v1.2.3-65-gdbad