Skip to content

Commit a05270f

Browse files
committed
Merge pull request #100 from nvdv/var_rename
Switch case for _clean_locals variable.
2 parents 9b0d6e0 + 73772a8 commit a05270f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

memory_profiler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Profile the memory usage of a Python program"""
22

33
# .. we'll use this to pass it to the child script ..
4-
_clean_globals = globals().copy()
4+
_CLEAN_GLOBALS = globals().copy()
55

66
__version__ = '0.32'
77

@@ -46,7 +46,7 @@ def _get_memory(pid, timestamps=False, include_children=False):
4646
if has_psutil:
4747
process = psutil.Process(pid)
4848
try:
49-
# avoid useing get_memory_info since it does not exists
49+
# avoid useing get_memory_info since it does not exists
5050
# in psutil > 2.0 and accessing it will cause exception.
5151
meminfo_attr = 'memory_info' if hasattr(process, 'memory_info') else 'get_memory_info'
5252
mem = getattr(process, meminfo_attr)()[0] / _TWO_20
@@ -877,13 +877,13 @@ def flush(self):
877877
# script where @profile is used)
878878
import __builtin__
879879
__builtin__.__dict__['profile'] = prof
880-
ns = copy(_clean_globals)
880+
ns = copy(_CLEAN_GLOBALS)
881881
ns['profile'] = prof # shadow the profile decorator defined above
882882
execfile(__file__, ns, ns)
883883
else:
884884
import builtins
885885
builtins.__dict__['profile'] = prof
886-
ns = copy(_clean_globals)
886+
ns = copy(_CLEAN_GLOBALS)
887887
ns['profile'] = prof # shadow the profile decorator defined above
888888
exec(compile(open(__file__).read(), __file__, 'exec'), ns, ns)
889889
finally:

0 commit comments

Comments
 (0)