mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-15 18:29:52 +00:00
[commands] Delete frame objects when done using them.
This commit is contained in:
parent
bbc78b29ae
commit
20e86973ea
@ -40,9 +40,13 @@ def _get_variable(name):
|
||||
stack = inspect.stack()
|
||||
try:
|
||||
for frames in stack:
|
||||
current_locals = frames[0].f_locals
|
||||
if name in current_locals:
|
||||
return current_locals[name]
|
||||
try:
|
||||
frame = frames[0]
|
||||
current_locals = frame.f_locals
|
||||
if name in current_locals:
|
||||
return current_locals[name]
|
||||
finally:
|
||||
del frame
|
||||
finally:
|
||||
del stack
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user