diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-04-07 22:17:42 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-04-07 22:17:42 +0000 |
commit | 28ecb49eac4b366a05c52714c9e1d68bd03c36f5 (patch) | |
tree | 473f66e2ca06ea0e1f0c69b05231c23c2018e77e | |
parent | 5e2170f56a1bb03edd4e0042be1541d6e65ceb88 (diff) | |
download | sqlalchemy-28ecb49eac4b366a05c52714c9e1d68bd03c36f5.tar.gz |
- Avoid cProfile on 2.4 (available via lsprof?)
-rw-r--r-- | test/testlib/profiling.py | 12 |
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) |