commit 2a72edef1c64b06bc5413449eecc38526bff21a2
Author: José Matos <jama...@lyx.org>
Date:   Mon Mar 17 10:36:11 2025 +0000

    Use _ convention for unused variable
    
    The usual convention, also recognised by linters, is to use an
    underscore when we explicitly want to ignore one function output.
    
    The other option would be not assign any value to the function output,
    but in this case we can not distinguish if this was done on purpose or
    not.
---
 lib/lyx2lyx/lyx_1_5.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py
index eddca0ada3..6cd26b617c 100644
--- a/lib/lyx2lyx/lyx_1_5.py
+++ b/lib/lyx2lyx/lyx_1_5.py
@@ -426,7 +426,7 @@ def revert_unicode_line(document, i, insets, spec_chars, 
replacement_character="
     for character in line:
         try:
             # Try to write the character
-            dummy = character.encode(document.encoding)
+            _ = character.encode(document.encoding)
             mod_line += character
             last_char = character
         except:
@@ -504,7 +504,7 @@ def revert_unicode(document):
         # Try to write the line
         try:
             # If all goes well the line is written here
-            dummy = line.encode(document.encoding)
+            _ = line.encode(document.encoding)
             i += 1
         except:
             # Error, some character(s) in the line need to be replaced
@@ -1388,7 +1388,7 @@ def revert_accent(document):
             ):
                 accent = document.body[i][j]
                 try:
-                    dummy = accent.encode(encoding_stack[-1])
+                    _ = accent.encode(encoding_stack[-1])
                 except UnicodeEncodeError:
                     # Insert the rest of the line as new line
                     if j < len(document.body[i]) - 1:
@@ -1407,7 +1407,7 @@ def revert_accent(document):
                     accented_char = inverse_accented_map[accented_char]
                 accent = document.body[i][j]
                 try:
-                    dummy = normalize("NFC", accented_char + 
accent).encode(encoding_stack[-1])
+                    _ = normalize("NFC", accented_char + 
accent).encode(encoding_stack[-1])
                 except UnicodeEncodeError:
                     # Insert the rest of the line as new line
                     if j < len(document.body[i]) - 1:
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to