Reduce width of exception handler for linfo file

ParsingError is only expected during read.
master
James Cameron 4 years ago
parent 2018c930ad
commit aca045bde2

@ -252,20 +252,21 @@ class ActivityBundle(Bundle):
cp = ConfigParser() cp = ConfigParser()
try: try:
cp.read_string(linfo_file.read().decode()) cp.read_string(linfo_file.read().decode())
except ParsingError as e:
logging.exception('Exception reading linfo file: %s', e)
return
section = 'Activity' section = 'Activity'
if cp.has_option(section, 'name'): if cp.has_option(section, 'name'):
self._name = cp.get(section, 'name') self._name = cp.get(section, 'name')
if cp.has_option(section, 'summary'): if cp.has_option(section, 'summary'):
self._summary = cp.get(section, 'summary') self._summary = cp.get(section, 'summary')
if cp.has_option(section, 'tags'): if cp.has_option(section, 'tags'):
tag_list = cp.get(section, 'tags').strip(';') tag_list = cp.get(section, 'tags').strip(';')
self._tags = [tag.strip() for tag in tag_list.split(';')] self._tags = [tag.strip() for tag in tag_list.split(';')]
except ParsingError as e:
logging.exception('Exception reading linfo file: %s', e)
def get_locale_path(self): def get_locale_path(self):
"""Get the locale path inside the (installed) activity bundle.""" """Get the locale path inside the (installed) activity bundle."""

Loading…
Cancel
Save