I have Python script written in 3.x version which I need to transform in 2.7 due to environment limitations.
I managed to refactor most of the syntax difs and module imports but I came across one line which I do not know how to handle:
def readConfigFile(self, file):
config = ConfigParser.ConfigParser(interpolation = ConfigParser.ExtendedInterpolation())
config.optionxform = str
config.read(file)
**config = ConfigParser.ConfigParser(interpolation = ConfigParser.ExtendedInterpolation())**
I found some reference here ( Python ConfigParser interpolation from foreign section) , but I do not know exactly how this can be replaced(refactored).
The ConfigParser :
in the 2.7 version : https://docs.python.org/2/library/configparser.html, but the ExtendedInterpolation() is not present
in the 3.x version : https://docs.python.org/3.2/library/configparser.html ,
So my question , is there any way to refactor the code above to work in python 2.7 and retain functionality ?