Skip to content

Commit 8bfa31c

Browse files
committed
20x speedup with ChatGPT tip
1 parent ddb5be6 commit 8bfa31c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/pymol/commanding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ def new_command(name, function=None, _self=cmd):
687687
# Inner function that will be callable every time the command is executed
688688
@wraps(function)
689689
def inner(*args, **kwargs):
690-
caller = traceback.extract_stack(limit=2)[0].filename
690+
caller = sys._getframe(1).f_code.co_filename
691691
# It was called from command line or pml script, so parse arguments
692692
if caller == _parser_filename:
693693
kwargs = {**kwargs, **dict(zip(args2_, args))}

0 commit comments

Comments
 (0)