[binutils-gdb] gdb/testsuite: rename ambiguous variable in py-command-breakpoint.py

Simon Marchi simark@sourceware.org
Thu Oct 30 16:27:29 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=750ef8f6e9c4d4767006782afeb75a06091904ff

commit 750ef8f6e9c4d4767006782afeb75a06091904ff
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Wed Oct 29 13:49:24 2025 -0400

    gdb/testsuite: rename ambiguous variable in py-command-breakpoint.py
    
    Fix this flake8 warning:
    
        gdb/testsuite/gdb.python/py-commands-breakpoint.py:37:13: E741 ambiguous variable name 'l'
    
    This one is a bit subjective, but renaming the variable is easy enough
    and the simplest way to get rid of the warning.
    
    Change-Id: I9b1ffd898e27a9d0e172f29715aff3ff3cc785b9
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 gdb/testsuite/gdb.python/py-commands-breakpoint.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-commands-breakpoint.py b/gdb/testsuite/gdb.python/py-commands-breakpoint.py
index dbe7676d6ba..df732e7922a 100644
--- a/gdb/testsuite/gdb.python/py-commands-breakpoint.py
+++ b/gdb/testsuite/gdb.python/py-commands-breakpoint.py
@@ -34,10 +34,10 @@ class PyCommandsBreakpoint(gdb.Breakpoint):
 
     def __setattr__(self, name, value):
         if name == "commands":
-            l = ["python PyCommandsBreakpoint.run_py_commands(%d)" % self.number]
+            cmds = ["python PyCommandsBreakpoint.run_py_commands(%d)" % self.number]
             if value != "":
-                l.append(value)
-            value = "\n".join(l)
+                cmds.append(value)
+            value = "\n".join(cmds)
 
         super().__setattr__(name, value)


More information about the Gdb-cvs mailing list