Skip to content

Commit

Permalink
Coderule script: fixes needed for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Aug 12, 2021
1 parent 4edd3d6 commit 0585f8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Utilities/ReleaseScripts/python/cmsCodeRules/Formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def writeRow(self, args, bold=False, cls=None) :
else:
self.outFile.write( " <tr>" + '\n')
for arg in args:
if string.strip(str(arg)) == "" : arg = "&nbsp;"
if str(arg).strip() == "" : arg = "&nbsp;"
if bold: self.outFile.write( '<td class=cellbold> ' )
else: self.outFile.write( " <td> " )
self.outFile.write( arg )
Expand All @@ -175,7 +175,7 @@ def writeStyledRow(self, args, styles) :
# we assume that headers are done by now !!
self.outFile.write( " <tr>" + '\n')
for arg, cellStyle in zip(args, styles):
if string.strip(str(arg)) == "" : arg = "&nbsp;"
if str(arg).strip() == "" : arg = "&nbsp;"
cellStyle = cellStyle.strip()
if cellStyle != '' : self.outFile.write( '<td class='+cellStyle+'> ' )
else: self.outFile.write( " <td> " )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def createPickleFile(fileName, listRule, path = os.getcwd()):
try:
for filePath, lines in listRule:
dict[filePath] = lines
file = open(join(path, fileName), 'w')
file = open(join(path, fileName), 'wb')
pickle.dump(dict, file)
file.close()
except TypeError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def readPicFiles(directory, toSplit = False):
ruleName = fileName[11:-4]
rulesNames.append(ruleName)

file = open(file)
file = open(file, 'rb')
ruleResult = pickle.load(file)
if toSplit:
ruleResult = splitToPackages(ruleResult)
Expand Down

0 comments on commit 0585f8d

Please sign in to comment.