From: Jason Kirtland Date: Mon, 7 Apr 2008 22:17:42 +0000 (+0000) Subject: - Avoid cProfile on 2.4 (available via lsprof?) X-Git-Tag: rel_0_5beta1~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28ecb49eac4b366a05c52714c9e1d68bd03c36f5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Avoid cProfile on 2.4 (available via lsprof?) --- 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)