debian/bin/kconfig.py: Adjust for compatibility with Python 3

Use open() instead of file().
Use dict.items() instead of .iteritems().
Use collections.OrderedDict.items() instead of .iteritems().
This commit is contained in:
Ben Hutchings 2015-08-30 21:34:13 +01:00
parent f56a30a44d
commit 3d1b880497
2 changed files with 4 additions and 4 deletions

View File

@ -11,10 +11,10 @@ from debian_linux.kconfig import *
def merge(output, configs, overrides):
kconfig = KconfigFile()
for c in configs:
kconfig.read(file(c))
for key, value in overrides.iteritems():
kconfig.read(open(c))
for key, value in overrides.items():
kconfig.set(key, value)
file(output, "w").write(str(kconfig))
open(output, "w").write(str(kconfig))
def opt_callback_dict(option, opt, value, parser):

View File

@ -87,5 +87,5 @@ class KconfigFile(OrderedDict):
self[key] = entry
def str_iter(self):
for key, value in self.iteritems():
for key, value in self.items():
yield str(value)