iteritems is deprececated or doesn't exist in future versions of

python3. Instead use list(somedict.items()).
This commit is contained in:
Benoit Chesneau 2010-05-17 06:48:28 +02:00 committed by Paul J. Davis
parent d46dfad91f
commit 6fbed7ba5b

View File

@ -28,7 +28,7 @@ class Application(object):
# Load up the any app specific configuration
if cfg:
for k, v in cfg.items():
for k, v in list(cfg.items()):
self.cfg.set(k.lower(), v)
# Load up the config file if its found.
@ -41,12 +41,12 @@ class Application(object):
traceback.print_exc()
sys.exit(1)
for k, v in cfg.iteritems():
for k, v in list(cfg.items()):
self.cfg.set(k.lower(), v)
# Lastly, update the configuration with any command line
# settings.
for k, v in opts.__dict__.iteritems():
for k, v in list(opts.__dict__.items()):
if v is None:
continue
self.cfg.set(k.lower(), v)