Skip to content

Commit 5c18be8

Browse files
committed
variable naming
1 parent f764000 commit 5c18be8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

unpythonic/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ def rename(f):
502502
# https://stackoverflow.com/questions/40661758/name-of-a-python-function-in-a-stack-trace
503503
# https://stackoverflow.com/questions/16064409/how-to-create-a-code-object-in-python
504504
f.__name__ = name
505-
j = f.__qualname__.rfind('.')
506-
f.__qualname__ = "{}.{}".format(f.__qualname__[:j], name) if j != -1 else name
505+
idx = f.__qualname__.rfind('.')
506+
f.__qualname__ = "{}.{}".format(f.__qualname__[:idx], name) if idx != -1 else name
507507
# __code__.co_name is read-only, but there's a types.CodeType constructor
508508
# that we can use to re-create the code object with the new name.
509509
# (This is no worse than what the stdlib's Lib/modulefinder.py already does.)

0 commit comments

Comments
 (0)