parent
fed7d0fb3d
commit
0064f70160
|
@ -40,8 +40,14 @@ def read_config(filename):
|
||||||
app.config.update(config)
|
app.config.update(config)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
with open(filename) as f:
|
||||||
|
# ConfigParser API changed in Python 3.2
|
||||||
|
if hasattr(configparser.ConfigParser, 'read_file'):
|
||||||
|
cparser = configparser.ConfigParser()
|
||||||
|
cparser.read_file(f)
|
||||||
|
else:
|
||||||
cparser = configparser.SafeConfigParser()
|
cparser = configparser.SafeConfigParser()
|
||||||
cparser.readfp(open(filename))
|
cparser.readfp(f)
|
||||||
|
|
||||||
config = {}
|
config = {}
|
||||||
for section in cparser.sections():
|
for section in cparser.sections():
|
||||||
|
|
Loading…
Reference in New Issue