Skip to content

Commit 5005a62

Browse files
authored
BF: Capture return value of choose_backend
Without this fix, I get `NameError: name '_backend' is not defined` when calling `exec_with_profiler` directly
1 parent 962ae2a commit 5005a62

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

memory_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ def exec_with_profiler(filename, profiler, backend):
11081108
execfile(filename, ns, ns)
11091109
else:
11101110
def exec_with_profiler(filename, profiler, backend):
1111-
choose_backend(backend)
1111+
_backend = choose_backend(backend)
11121112
if _backend == 'tracemalloc' and has_tracemalloc:
11131113
tracemalloc.start()
11141114
builtins.__dict__['profile'] = profiler

0 commit comments

Comments
 (0)