[PATCH] Re: Import cProfile module before falling back to profile

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon Dec 6 17:23:10 GMT 2010


On Mon, Dec 06, 2010 at 01:19:31PM +0100, Sebastian Spaeth wrote:

> 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

How do we know which library is currently used?

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list