frappyman: raise from None

This commit is contained in:
zolliker 2022-06-08 16:40:17 +02:00
parent ac9e35123c
commit 34e13ccc67

View File

@ -55,8 +55,8 @@ class FrappyManager(ServiceManager):
section = cfgparser['FRAPPY'] section = cfgparser['FRAPPY']
except KeyError: except KeyError:
if exists(cfgfile): if exists(cfgfile):
raise KeyError('%s has no FRAPPY section' % cfgfile) raise KeyError('%s has no FRAPPY section' % cfgfile) from None
raise FileNotFoundError('%s does not exist' % cfgfile) raise FileNotFoundError('%s not found' % cfgfile) from None
for cfgpath in section['confdir'].split(os.pathsep): for cfgpath in section['confdir'].split(os.pathsep):
if cfgpath.endswith('<SERV>'): if cfgpath.endswith('<SERV>'):
cfgpaths.append(cfgpath[:-6] + service) cfgpaths.append(cfgpath[:-6] + service)