[Tarantool-patches] [PATCH luajit 14/15] test: fix E741 errors by pycodestyle

Igor Munkin imun at tarantool.org
Thu Aug 3 10:30:39 MSK 2023


Fixed 3 occurrences of E741 ("ambiguous variable name 'l'") error
reported by pycodestyle[1].

[1]: https://www.flake8rules.com/rules/E741.html

Signed-off-by: Igor Munkin <imun at tarantool.org>
---
 src/luajit-gdb.py  |  6 +++---
 src/luajit_lldb.py | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py
index a0c8f24e..2e0b145b 100644
--- a/src/luajit-gdb.py
+++ b/src/luajit-gdb.py
@@ -233,15 +233,15 @@ def L(L=None):
     # lookup a symbol for the main coroutine considering the host app
     # XXX Fragile: though the loop initialization looks like a crap but it
     # respects both Python 2 and Python 3.
-    for l in [L] + list(map(lambda l: lookup(l), (
+    for coroutine in [L] + list(map(lambda main: lookup(main), (
         # LuaJIT main coro (see luajit/src/luajit.c)
         'globalL',
         # Tarantool main coro (see tarantool/src/lua/init.h)
         'tarantool_L',
         # TODO: Add more
     ))):
-        if l:
-            return cast('lua_State *', l)
+        if coroutine:
+            return cast('lua_State *', coroutine)
 
 
 def G(L):
diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py
index 4787c62c..76fb3141 100644
--- a/src/luajit_lldb.py
+++ b/src/luajit_lldb.py
@@ -453,15 +453,15 @@ def L(L=None):
     # lookup a symbol for the main coroutine considering the host app
     # XXX Fragile: though the loop initialization looks like a crap but it
     # respects both Python 2 and Python 3.
-    for l in [L] + list(map(lambda l: lookup_global(l), (
+    for coroutine in [L] + list(map(lambda main: lookup_global(main), (
         # LuaJIT main coro (see luajit/src/luajit.c)
         'globalL',
         # Tarantool main coro (see tarantool/src/lua/init.h)
         'tarantool_L',
         # TODO: Add more
     ))):
-        if l:
-            return lua_State(l)
+        if coroutine:
+            return lua_State(coroutine)
 
 
 def tou32(val):
@@ -1066,9 +1066,9 @@ coroutine guest stack:
 If L is ommited the main coroutine is used.
     '''
     def execute(self, debugger, args, result):
-        l = self.parse(args)
-        l_ptr = cast('lua_State *', l) if l is not None else None
-        print('{}'.format(dump_stack(L(l_ptr))))
+        coro = self.parse(args)
+        coro_ptr = cast('lua_State *', coro) if coro is not None else None
+        print('{}'.format(dump_stack(L(coro_ptr))))
 
 
 def register_commands(debugger, commands):
-- 
2.30.2



More information about the Tarantool-patches mailing list