Commit bc04413d authored by Kipp Cannon's avatar Kipp Cannon

Merge branch 'python3_fixes' into 'master'

Various Python 3 compatibility fixes

See merge request !55
parents d2db72a3 2ddc13d5
Pipeline #47098 failed with stages
in 3 minutes and 25 seconds
......@@ -33,7 +33,6 @@ __version__ = git_version.id
import os
import sys
import string
import re
import csv
try:
......
......@@ -27,7 +27,7 @@ __version__ = git_version.id
import os
import sys
import string, re
import re
import time
import random
import math
......@@ -632,7 +632,7 @@ class CondorJob(object):
@param section: section of the ini file to add to the options.
"""
for opt in cp.options(section):
arg = string.strip(cp.get(section,opt))
arg = str(cp.get(section,opt)).strip()
self.__options[opt] = arg
def set_notification(self, value):
......@@ -1027,7 +1027,7 @@ class CondorDAGNode(object):
t = str( int( time.time() * 1000 ) )
r = str( int( random.random() * 100000000000000000 ) )
a = str( self.__class__ )
self.__name = md5(t + r + a).hexdigest()
self.__name = md5((t + r + a).encode()).hexdigest()
self.__md5name = self.__name
def __repr__(self):
......@@ -2428,7 +2428,7 @@ class AnalysisJob(object):
self.__cp = cp
self.__dax = dax
try:
self.__channel = string.strip(self.__cp.get('input','channel'))
self.__channel = str(self.__cp.get('input','channel')).strip()
except:
self.__channel = None
......@@ -2445,7 +2445,7 @@ class AnalysisJob(object):
@param sec: ini file section.
@param opt: option from section sec.
"""
return string.strip(self.__cp.get(sec,opt))
return str(self.__cp.get(sec,opt)).strip()
def set_channel(self,channel):
"""
......@@ -3755,9 +3755,9 @@ class LSCDataFindJob(CondorDAGJob, AnalysisJob):
# we have to do this manually for backwards compatibility with type
for o in self.__config_file.options('datafind'):
opt = string.strip(o)
opt = str(o).strip()
if opt[:4] != "type":
arg = string.strip(self.__config_file.get('datafind',opt))
arg = str(self.__config_file.get('datafind',opt)).strip()
self.add_opt(opt,arg)
if self.__dax:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment