From 28ecb49eac4b366a05c52714c9e1d68bd03c36f5 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Mon, 7 Apr 2008 22:17:42 +0000 Subject: [PATCH] - Avoid cProfile on 2.4 (available via lsprof?) --- test/testlib/profiling.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/testlib/profiling.py b/test/testlib/profiling.py index edaeabdad1..b452d1fb82 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) -- 2.47.3