Printing the entire traceback, instead of just a warning, when an exception is encoun...
authorLucian Ursu <lucian.ursu@gmail.com>
Tue, 10 Jan 2012 10:10:58 +0000 (12:10 +0200)
committerLucian Ursu <lucian.ursu@gmail.com>
Tue, 10 Jan 2012 10:10:58 +0000 (12:10 +0200)
requests/hooks.py

index f9cf480..37f87d9 100644 (file)
@@ -22,7 +22,7 @@ Available hooks:
 
 """
 
-import warnings
+import traceback
 
 
 def dispatch_hook(key, hooks, hook_data):
@@ -34,7 +34,7 @@ def dispatch_hook(key, hooks, hook_data):
         try:
             return hooks.get(key).__call__(hook_data) or hook_data
 
-        except Exception, why:
-            warnings.warn(str(why))
+        except Exception:
+            traceback.print_exc()
 
     return hook_data