summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-06-26 10:00:05 +0200
committerCarl Hetherington <cth@carlh.net>2023-06-26 10:02:38 +0200
commit6d4d2d17c882c9d8d59311c96b45b18ab5f51715 (patch)
tree02e1afafca8c72ab3ba69fcf987dffac81572603
parent45fd3e380b4c91da89a03d889d6b8a0861e9915d (diff)
Cleanup: remove pointless try/except.
-rwxr-xr-xcdist29
1 files changed, 13 insertions, 16 deletions
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: