-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alec Flett wrote:
> Enclosed is a small patch to make repoze.profile use cProfile if it is  
> available. The APIs should be the same, and this appears to work on OS  
> X / Leopard's default python 2.5

Thanks for the patch.  It needs to adjust both places where the profiler
is instantiated (the original one gets tossed by default after the first
request).  I'm attaching an updated patch for those playing along at home.

Merged for repoze.profile 0.4.  Thanks again!


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH3xlA+gerLs4ltQ4RAjM2AJ4lj2JYNhSkNiJBk440f6Ow0Qnw9gCeMBqo
2k1a9P772IACrJ/2TwfZmak=
=nbwU
-----END PGP SIGNATURE-----
Index: repoze/profile/profiler.py
===================================================================
--- repoze/profile/profiler.py	(revision 819)
+++ repoze/profile/profiler.py	(working copy)
@@ -3,7 +3,11 @@
 o Insprired by the paste.debug.profile version, which profiles single requests.
 """
 import os
-import profile
+try:
+    import cProfile as profile
+except ImportError:
+    import profile
+    
 import pstats
 import sys
 import StringIO
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to