default hooks copy fixed
authorLuca De Vitis <luca@monkeython.com>
Thu, 25 Aug 2011 14:24:55 +0000 (16:24 +0200)
committerLuca De Vitis <luca@monkeython.com>
Thu, 25 Aug 2011 14:24:55 +0000 (16:24 +0200)
requests/hooks/__init__.py

index 730e6bb34f261a79ea0334b53043baea44e36950..e737bffb3b89165e8679e09a48aaaa659fc5b210 100644 (file)
@@ -42,7 +42,8 @@ def setup_hooks(supplied):
     """
 
     # Copy the default hooks settings.
-    dispatching = dict([(k, v[:]) for k, v in config.settings.default_hooks])
+    default = config.settings.default_hooks
+    dispatching = dict([(k, v[:]) for k, v in default.items()])
 
     # I abandoned the idea of a dictionary of sets because sets may not keep
     # insertion order, while it may be important. Also, there is no real reason