[PATCH 09/17] Import cProfile module before falling back to profile
    Sebastian Spaeth 
    Sebastian at SSpaeth.de
       
    Mon Nov 29 16:02:17 GMT 2010
    
    
  
Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 offlineimap/threadutil.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/offlineimap/threadutil.py b/offlineimap/threadutil.py
index b516f68..c65700e 100644
--- a/offlineimap/threadutil.py
+++ b/offlineimap/threadutil.py
@@ -148,7 +148,10 @@ class ExitNotifyThread(Thread):
             if not profiledir:          # normal case
                 Thread.run(self)
             else:
-                import profile
+                try:
+                    import cProfile as profile
+                except ImportError:
+                    import profile
                 prof = profile.Profile()
                 try:
                     prof = prof.runctx("Thread.run(self)", globals(), locals())
-- 
1.7.1
    
    
More information about the OfflineIMAP-project
mailing list