Cleanup: remove pointless try/except.
authorCarl Hetherington <cth@carlh.net>
Mon, 26 Jun 2023 08:00:05 +0000 (10:00 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 26 Jun 2023 08:02:38 +0000 (10:02 +0200)
cdist

diff --git a/cdist b/cdist
index 400300e9a2fd4b688219c8b8538db695b0552978..5ba3eb4b337b76882db195d77f2890b26617aca3 100755 (executable)
--- 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: