commit a5ddcf500b4b13d79669d147f01f7845d13ba2e3
Author: José Matos <[email protected]>
Date:   Mon Mar 17 10:32:28 2025 +0000

    Python code cleanup: be explicit about the exception to be catched
    
    It is a good practice to declare what is the exception that we want to
    catch or else we risk to mask other errors
---
 lib/lyx2lyx/lyx2lyx_tools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py
index 2496ea7f99..561ee012f7 100644
--- a/lib/lyx2lyx/lyx2lyx_tools.py
+++ b/lib/lyx2lyx/lyx2lyx_tools.py
@@ -583,7 +583,7 @@ def hex2ratio(s):
     "Converts an RRGGBB-type hexadecimal string to a float in [0.0,1.0]"
     try:
         val = int(s, 16)
-    except:
+    except ValueError:
         val = 0
     if val != 0:
         val += 1
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to