From a392a87389d39b5e2ad88f29df334d67f41188e9 Mon Sep 17 00:00:00 2001 From: Jian Li Date: Wed, 9 Jan 2013 22:07:38 -0800 Subject: [PATCH] Retrieve kwargs.keys() just once. --- requests/sessions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requests/sessions.py b/requests/sessions.py index 697ce2e..b29f13e 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -60,8 +60,9 @@ def merge_kwargs(local_kwarg, default_kwarg): return new_key kwargs = default_kwarg.copy() + original_keys = kwargs.keys() for key, value in local_kwarg.items(): - kwargs[get_original_key(kwargs.keys(), key)] = value + kwargs[get_original_key(original_keys, key)] = value # Remove keys that are set to None. for (k, v) in local_kwarg.items(): -- 2.7.4