summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-04-07 22:17:42 +0000
committerJason Kirtland <jek@discorporate.us>2008-04-07 22:17:42 +0000
commit28ecb49eac4b366a05c52714c9e1d68bd03c36f5 (patch)
tree473f66e2ca06ea0e1f0c69b05231c23c2018e77e
parent5e2170f56a1bb03edd4e0042be1541d6e65ceb88 (diff)
downloadsqlalchemy-28ecb49eac4b366a05c52714c9e1d68bd03c36f5.tar.gz
- Avoid cProfile on 2.4 (available via lsprof?)
-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)