mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
Made errors more Python version-independent.
This commit is contained in:
parent
95fbf9527f
commit
d08f139c22
3
cfg.py
3
cfg.py
@ -1,12 +1,13 @@
|
||||
from menu import Menu
|
||||
import os
|
||||
|
||||
import ConfigParser
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
def get_item(parser, section, name):
|
||||
try:
|
||||
return parser.get(section, name)
|
||||
except (SafeConfigParser.NoSectionError, SafeConfigParser.NoOptionError):
|
||||
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
|
||||
print ("The config file {} does not contain the {}.{} option.".format(
|
||||
parser[0], section, name))
|
||||
raise
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user