[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/testing/test.py
Import hotshot only if profiling is enabled.
Marius Gedminas
marius at pov.lt
Wed Feb 23 07:37:12 EST 2005
Log message for revision 29259:
Import hotshot only if profiling is enabled.
It was recently discovered that the standard Python profile module comes
with a licence that is not entirely free. Some Linux distributions
consequently removed it from the standard Python distribution and moved it into
a separate non-free package. As a result, 'import hotshot.stats' fails
because it tries to reuse the pstats module from the standard profiler.
Changed:
U Zope3/trunk/src/zope/app/testing/test.py
-=-
Modified: Zope3/trunk/src/zope/app/testing/test.py
===================================================================
--- Zope3/trunk/src/zope/app/testing/test.py 2005-02-23 11:44:01 UTC (rev 29258)
+++ Zope3/trunk/src/zope/app/testing/test.py 2005-02-23 12:37:11 UTC (rev 29259)
@@ -256,7 +256,6 @@
$Id$
"""
import gc
-import hotshot, hotshot.stats
import logging
import os
import re
@@ -451,6 +450,7 @@
def run(self, test):
self.result.count = test.countTestCases()
if self._profile:
+ import hotshot, hotshot.stats
prof = hotshot.Profile("tests_profile.prof")
args = (self, test)
r = prof.runcall(unittest.TextTestRunner.run, *args)
More information about the Zope3-Checkins
mailing list