profiling icon indicating copy to clipboard operation
profiling copied to clipboard

dump method of Profiler class is missing in pypi

Open MJ111 opened this issue 7 years ago • 1 comments

https://pypi.org/project/profiling/#files

could you download this and check profiler.py? there's no dump method in there.

for some reason, there's mismatch between github master branch and latest pypi package.

MJ111 avatar Oct 08 '18 06:10 MJ111

yep, this is still the case. Ive included this snippet inside my code so dump works (copied+modified from the source);

import pickle

def dump(profiler, filename, pickle_protocol=pickle.HIGHEST_PROTOCOL):
    result = profiler.result()
    with open(filename, 'wb') as f:
        pickle.dump((profiler.__class__, result), f, pickle_protocol)

sinanm89 avatar Oct 11 '19 17:10 sinanm89