summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
7ff0f5c)
ConfigParser has been renamed to configparser in py3, account for
this to support running the scripts with python 3.x.
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: Ia61134a7528ba710a3bca3bfefd97d32ae2fd3d3
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
+try:
+ import ConfigParser as configparser
+except ImportError:
+ import configparser
from tools.statics import BUILD_CONFIG_PATH
from tools.statics import BUILD_CONFIG_PATH
return str(option).replace('#ARCH#', platform.machine())
return str(option).replace('#ARCH#', platform.machine())
-class BuildConfigParser(ConfigParser.ConfigParser):
+class BuildConfigParser(configparser.ConfigParser): # pylint: disable=too-many-ancestors
def __init__(self, ini_file=BUILD_CONFIG_PATH):
def __init__(self, ini_file=BUILD_CONFIG_PATH):
- ConfigParser.ConfigParser.__init__(self)
+ configparser.ConfigParser.__init__(self)
self.ini_file = ini_file
self.optionxform = optionxform_arch
self.read(self.ini_file)
self.ini_file = ini_file
self.optionxform = optionxform_arch
self.read(self.ini_file)
def items(self, section): # pylint: disable=arguments-differ
defaults = self.defaults()
resultlist = []
def items(self, section): # pylint: disable=arguments-differ
defaults = self.defaults()
resultlist = []
- for item in ConfigParser.ConfigParser.items(self, section):
+ for item in configparser.ConfigParser.items(self, section):
if item[0] not in defaults:
resultlist.append(item)
return resultlist
if item[0] not in defaults:
resultlist.append(item)
return resultlist