From: Carl Hetherington Date: Mon, 26 Jun 2023 08:00:05 +0000 (+0200) Subject: Cleanup: remove pointless try/except. X-Git-Url: https://git.carlh.net/gitweb/?p=cdist.git;a=commitdiff_plain;h=6d4d2d17c882c9d8d59311c96b45b18ab5f51715 Cleanup: remove pointless try/except. --- diff --git a/cdist b/cdist index 400300e..5ba3eb4 100755 --- a/cdist +++ b/cdist @@ -140,22 +140,19 @@ class Config: print('Template config file written to %s; please edit and try again.' % config_file, file=sys.stderr) sys.exit(1) - try: - f = open('%s/.config/cdist' % os.path.expanduser('~'), 'r') - while True: - l = f.readline() - if l == '': - break - - if len(l) > 0 and l[0] == '#': - continue - - s = l.strip().split() - if len(s) == 2: - for k in self.options: - k.offer(s[0], s[1]) - except: - raise + f = open('%s/.config/cdist' % os.path.expanduser('~'), 'r') + while True: + l = f.readline() + if l == '': + break + + if len(l) > 0 and l[0] == '#': + continue + + s = l.strip().split() + if len(s) == 2: + for k in self.options: + k.offer(s[0], s[1]) def has(self, k): for o in self.options: