Commit 5260f106 authored by Ross Patterson's avatar Ross Patterson

The Control_Panel/DebugInfo/manage_profile ZMI view fixes were

accumulating successive prints of stats.
parent 7c6f7af2
......@@ -19,6 +19,7 @@ from logging import getLogger
import os
import sys
import time
from cStringIO import StringIO
from AccessControl.requestmethod import requestmethod
from AccessControl.SecurityManagement import getSecurityManager
......@@ -235,8 +236,9 @@ class DebugManager(Item, Implicit):
from copy import copy; stats= copy(stats)
stats.strip_dirs()
stats.sort_stats(sort)
stats.stream = output = StringIO()
getattr(stats,'print_%s' % mode)(limit)
return stats.stream.getvalue()
return output.getvalue()
def manage_getSysPath(self):
return list(sys.path)
......
......@@ -408,9 +408,7 @@ def publish_module_profiled(module_name, stdin=sys.stdin, stdout=sys.stdout,
result=sys._pr_
pobj.create_stats()
if _pstat is None:
from cStringIO import StringIO
stream = StringIO()
_pstat = sys._ps_ = pstats.Stats(pobj, stream=stream)
_pstat = sys._ps_ = pstats.Stats(pobj)
else: _pstat.add(pobj)
finally:
_plock.release()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment