mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 21:32:12 +02:00
scripts: Rename ConfigParser -> configparser for python3
The ConfigParser API was renamed to configparser in python 3. Renamed ConfigParser -> configparser in scripts/ to make the code working in python 3. (From OE-Core rev: de6e98f272e623ce72e724e66920eecf10cb2d41) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
3ee70cb725
commit
fa4275bbc0
@@ -22,7 +22,7 @@ import os
|
||||
import argparse
|
||||
import glob
|
||||
import re
|
||||
import ConfigParser
|
||||
import configparser
|
||||
import subprocess
|
||||
import logging
|
||||
|
||||
@@ -51,12 +51,12 @@ class ConfigHandler(object):
|
||||
|
||||
def __init__(self, filename):
|
||||
self.config_file = filename
|
||||
self.config_obj = ConfigParser.SafeConfigParser()
|
||||
self.config_obj = configparser.SafeConfigParser()
|
||||
|
||||
def get(self, section, option, default=None):
|
||||
try:
|
||||
ret = self.config_obj.get(section, option)
|
||||
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
|
||||
except (configparser.NoOptionError, configparser.NoSectionError):
|
||||
if default != None:
|
||||
ret = default
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user