summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/testlib/profiling.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/testlib/profiling.py b/test/testlib/profiling.py
index edaeabdad..b452d1fb8 100644
--- a/test/testlib/profiling.py
+++ b/test/testlib/profiling.py
@@ -165,11 +165,13 @@ def conditional_call_count(discriminator, categories):
def _profile(filename, fn, *args, **kw):
global profiler
if not profiler:
- try:
- import cProfile
- profiler = 'cProfile'
- except ImportError:
- profiler = 'hotshot'
+ profiler = 'hotshot'
+ if sys.version_info > (2, 5):
+ try:
+ import cProfile
+ profiler = 'cProfile'
+ except ImportError:
+ pass
if profiler == 'cProfile':
return _profile_cProfile(filename, fn, *args, **kw)