Author: tomaz
Date: Fri May 24 19:00:31 2013
New Revision: 1486170

URL: http://svn.apache.org/r1486170
Log:
Only import libcloud.utils.debug module if enable_requests_stats environment
variable is set.

Modified:
    libcloud/branches/0.12.x/libcloud/__init__.py

Modified: libcloud/branches/0.12.x/libcloud/__init__.py
URL: 
http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/__init__.py?rev=1486170&r1=1486169&r2=1486170&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/__init__.py (original)
+++ libcloud/branches/0.12.x/libcloud/__init__.py Fri May 24 19:00:31 2013
@@ -32,9 +32,6 @@ except ImportError:
     have_paramiko = False
 
 
-from libcloud.utils.debug import print_request_statistics
-
-
 def enable_debug(fo):
     """
     Enable library wide debugging to a file-like object.
@@ -55,6 +52,8 @@ def enable_debug(fo):
     enable_requests_stats = os.getenv('LIBCLOUD_REQUESTS_STATS')
 
     if enable_requests_stats:
+        from libcloud.utils.debug import print_request_statistics
+
         LoggingHTTPSConnection.enable_requests_stats = True
         LoggingHTTPConnection.enable_requests_stats = True
         atexit.register(print_request_statistics, fo=fo,


Reply via email to