From 7de6b1e1626b72ae473def49ccc1764d11323167 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 1 May 2013 21:49:46 +0100 Subject: [PATCH] Instantiate the CID directly. No need to do this the slow way now. Thanks to Colin (@cdunklau) for the idea. --- requests/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requests/models.py b/requests/models.py index 62cd0f56..10fa1f0f 100644 --- a/requests/models.py +++ b/requests/models.py @@ -346,8 +346,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): """Prepares the given HTTP headers.""" if headers: - headers = dict((to_native_string(name), value) for name, value in headers.items()) - self.headers = CaseInsensitiveDict(headers) + self.headers = CaseInsensitiveDict((to_native_string(name), value) for name, value in headers.items()) else: self.headers = CaseInsensitiveDict()