[New-bugs-announce] [issue25726] sys.setprofile / sys.getprofile asymetry

Stefan Seefeld report at bugs.python.org
Tue Nov 24 18:04:27 EST 2015


New submission from Stefan Seefeld:

I'm using the `cProfile` module to profile my code.

I tried to temporarily disable the profiler by using:

  prof = sys.getprofile()
  sys.setprofile(None)
  ...
   sys.setprofile(prof)

resulting in an error.

The reason is that with `cProfile`, `sys.getprofile` returns the profile object itself, which isn't suitable as argument for `sys.setprofile` (which expects a callable).

Notice that if I use the `profile` module instead of `cProfile`, the above works fine.

----------
messages: 255301
nosy: stefan
priority: normal
severity: normal
status: open
title: sys.setprofile / sys.getprofile asymetry
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25726>
_______________________________________


More information about the New-bugs-announce mailing list