From 8bba3d80b3e72290d8fb753716be7f680bcd07e2 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Mon, 19 Jun 2023 17:30:28 +0200
Subject: [PATCH] Raise OSError exception instead of exiting

OSError is more specific than SystemExit. It is better to have a more
specific exception when we want to catch it.
---
 Common/util_eddies.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Common/util_eddies.py b/Common/util_eddies.py
index adb82000..dbb5e336 100644
--- a/Common/util_eddies.py
+++ b/Common/util_eddies.py
@@ -15,7 +15,8 @@ class SHPC_class:
         """
 
         if not os.access(SHPC_dir, os.R_OK):
-            sys.exit(f"{SHPC_dir} not readable")
+            print(f"{SHPC_dir} not readable")
+            raise OSError
 
         self.dir = SHPC_dir
         self.def_orient = def_orient
-- 
GitLab