From 86eba21b8ae7ed3772f5706e1c5799efc127342b Mon Sep 17 00:00:00 2001 From: Lucian Ursu Date: Tue, 10 Jan 2012 12:10:58 +0200 Subject: [PATCH] Printing the entire traceback, instead of just a warning, when an exception is encountered --- requests/hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requests/hooks.py b/requests/hooks.py index f9cf480..37f87d9 100644 --- a/requests/hooks.py +++ b/requests/hooks.py @@ -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 -- 2.7.4