diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-19 12:28:12 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:01 +0100 |
commit | fa4275bbc0098124f3b44e0eafae83692db778b9 (patch) | |
tree | 3285957da8be3052b7cc77bed4765e99436674c8 | |
parent | 3ee70cb7259aad3b53e51884ec5b9122e804d77e (diff) | |
download | poky-fa4275bbc0098124f3b44e0eafae83692db778b9.tar.gz |
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>
-rwxr-xr-x | scripts/combo-layer | 6 | ||||
-rwxr-xr-x | scripts/contrib/python/generate-manifest-3.5.py | 2 | ||||
-rwxr-xr-x | scripts/devtool | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer index 52367f091d..234d9e447b 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer | |||
@@ -26,7 +26,7 @@ import optparse | |||
26 | import logging | 26 | import logging |
27 | import subprocess | 27 | import subprocess |
28 | import tempfile | 28 | import tempfile |
29 | import ConfigParser | 29 | import configparser |
30 | import re | 30 | import re |
31 | import copy | 31 | import copy |
32 | import pipes | 32 | import pipes |
@@ -87,7 +87,7 @@ class Configuration(object): | |||
87 | self.commit_msg_template = value | 87 | self.commit_msg_template = value |
88 | 88 | ||
89 | logger.debug("Loading config file %s" % self.conffile) | 89 | logger.debug("Loading config file %s" % self.conffile) |
90 | self.parser = ConfigParser.ConfigParser() | 90 | self.parser = configparser.ConfigParser() |
91 | with open(self.conffile) as f: | 91 | with open(self.conffile) as f: |
92 | self.parser.readfp(f) | 92 | self.parser.readfp(f) |
93 | 93 | ||
@@ -116,7 +116,7 @@ class Configuration(object): | |||
116 | 116 | ||
117 | self.localconffile = lcfile | 117 | self.localconffile = lcfile |
118 | logger.debug("Loading local config file %s" % self.localconffile) | 118 | logger.debug("Loading local config file %s" % self.localconffile) |
119 | self.localparser = ConfigParser.ConfigParser() | 119 | self.localparser = configparser.ConfigParser() |
120 | with open(self.localconffile) as f: | 120 | with open(self.localconffile) as f: |
121 | self.localparser.readfp(f) | 121 | self.localparser.readfp(f) |
122 | 122 | ||
diff --git a/scripts/contrib/python/generate-manifest-3.5.py b/scripts/contrib/python/generate-manifest-3.5.py index 41f209b17f..e04da1de71 100755 --- a/scripts/contrib/python/generate-manifest-3.5.py +++ b/scripts/contrib/python/generate-manifest-3.5.py | |||
@@ -167,7 +167,7 @@ if __name__ == "__main__": | |||
167 | # | 167 | # |
168 | 168 | ||
169 | m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math", | 169 | m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math", |
170 | "__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* ConfigParser.* " + | 170 | "__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* configparser.* " + |
171 | "genericpath.* getopt.* linecache.* new.* " + | 171 | "genericpath.* getopt.* linecache.* new.* " + |
172 | "os.* posixpath.* struct.* " + | 172 | "os.* posixpath.* struct.* " + |
173 | "warnings.* site.* stat.* " + | 173 | "warnings.* site.* stat.* " + |
diff --git a/scripts/devtool b/scripts/devtool index 9ac6e798d2..4dbb527bc7 100755 --- a/scripts/devtool +++ b/scripts/devtool | |||
@@ -22,7 +22,7 @@ import os | |||
22 | import argparse | 22 | import argparse |
23 | import glob | 23 | import glob |
24 | import re | 24 | import re |
25 | import ConfigParser | 25 | import configparser |
26 | import subprocess | 26 | import subprocess |
27 | import logging | 27 | import logging |
28 | 28 | ||
@@ -51,12 +51,12 @@ class ConfigHandler(object): | |||
51 | 51 | ||
52 | def __init__(self, filename): | 52 | def __init__(self, filename): |
53 | self.config_file = filename | 53 | self.config_file = filename |
54 | self.config_obj = ConfigParser.SafeConfigParser() | 54 | self.config_obj = configparser.SafeConfigParser() |
55 | 55 | ||
56 | def get(self, section, option, default=None): | 56 | def get(self, section, option, default=None): |
57 | try: | 57 | try: |
58 | ret = self.config_obj.get(section, option) | 58 | ret = self.config_obj.get(section, option) |
59 | except (ConfigParser.NoOptionError, ConfigParser.NoSectionError): | 59 | except (configparser.NoOptionError, configparser.NoSectionError): |
60 | if default != None: | 60 | if default != None: |
61 | ret = default | 61 | ret = default |
62 | else: | 62 | else: |