Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX --pdb-mmem

  • Loading branch information...
commit 64b0a5dc43c3992b891d97e3345c8ef174a2c1aa 1 parent 523b4ba
@fabianp authored
Showing with 2 additions and 1 deletion.
  1. +1 −1  memory_profiler.py
  2. +1 −0  test/test_with.py
View
2  memory_profiler.py
@@ -253,7 +253,7 @@ def trace_memory_usage(self, frame, event, arg):
def trace_max_mem(self, frame, event, arg):
# run into PDB as soon as memory is higher than MAX_MEM
- if event in ('line', 'return'):
+ if event in ('line', 'return') and frame.f_code in self.code_map:
c = _get_memory(os.getpid())
if c >= self.max_mem:
t = 'Current memory {0:.2f} MB exceeded the maximum '.format(c) + \
View
1  test/test_with.py
@@ -0,0 +1 @@
+__author__ = 'fabian'
Please sign in to comment.
Something went wrong with that request. Please try again.