Skip to content

Is there a specific reason memory_usage return None when stream=True ? #397

@PveOnly

Description

@PveOnly

Hi, I'm just wondering why when stream is not None, memory_usage return None ?
https://github.com/pythonprofilers/memory_profiler/blob/a99a3c3b3c2eb01c90f6e14ddfcb85b3e97f9885/memory_profiler.py#L478C6-L478C6

I'm using stream + retval so my script is crashing since i'm getting a None object when doing
mem_usage,res=memory_usage((func,args,kwargs),stream=True, retval=True

My current fix is just removing the if stream : return None, but I would like to know if it will bite me later or if it's fine ?
I'm really not familiar with memory usage so maybe there is a specific reason.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions