]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Avoid cProfile on 2.4 (available via lsprof?)
authorJason Kirtland <jek@discorporate.us>
Mon, 7 Apr 2008 22:17:42 +0000 (22:17 +0000)
committerJason Kirtland <jek@discorporate.us>
Mon, 7 Apr 2008 22:17:42 +0000 (22:17 +0000)
test/testlib/profiling.py

index edaeabdad184eab0f75ac84b648857b50fa38f12..b452d1fb827498d42c1f5e72d91d28f0750f2e66 100644 (file)
@@ -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)