Skip to content

Commit df4304f

Browse files
committed
fixed write bug
1 parent 730171a commit df4304f

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
@@ -398,7 +398,7 @@ def memory_usage(proc=-1, interval=.1, timeout=None, timestamps=False,
398398
proc.pid, backend, timestamps=timestamps,
399399
include_children=include_children)
400400

401-
if stream is not None:
401+
if mem_usage and stream is not None:
402402
stream.write("MEM {0:.6f} {1:.4f}\n".format(*mem_usage))
403403

404404
# Write children to the stream file

0 commit comments

Comments
 (0)