Skip to content

Commit

Permalink
Merge pull request #28161 from mrodozov/fix-py3-test-condTestRegression
Browse files Browse the repository at this point in the history
Fix condTestRegression unittest for py3
  • Loading branch information
cmsbuild committed Oct 15, 2019
2 parents e497640 + 6258436 commit bfdd043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CondCore/CondDB/test/condTestRegression.py
Expand Up @@ -139,7 +139,7 @@ def run(self, rel, arch, readOrWrite, dbName):
self.dbList['%s [%s]'%(rel,arch)] = dbName

cmd ="scram -a %s list -c %s | grep '\\b%s\\b' | head -1 | sed 's|.* ||'" %(arch,rel,rel)
out =check_output(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
out =check_output(cmd, shell=True, universal_newlines=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
ind = out.find( arch )
if ind == -1:
raise Exception('Could not locate the reference release %s with "%s" [ got %s ]' %(rel,cmd,out))
Expand All @@ -154,7 +154,7 @@ def run(self, rel, arch, readOrWrite, dbName):

try:
#opening a process with a clean environment ( to avoid to inherit scram variables )
res = check_output(cmd, shell=True, env={}, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
res = check_output(cmd, shell=True, universal_newlines=True, env={}, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
except Exception as e:
self.log( rel, arch, readOrWrite, str(e) )
raise e
Expand Down Expand Up @@ -190,7 +190,7 @@ def runSelf(self, readOrWrite, dbNameIn=None):
cmd += '%s %s sqlite_file:///%s/%s ' % (executable, readOrWrite, self.dbDir, dbName)

try:
res = check_output(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
res = check_output(cmd, shell=True, universal_newlines=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
except Exception as e:
self.log( self.rel, self.arch, readOrWrite, str(e) )
raise e
Expand Down

0 comments on commit bfdd043

Please sign in to comment.