From 72b0c55bef280221daa3de24f199a2ae4ef01eff Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Fri, 2 Mar 2018 08:27:59 -0700 Subject: [PATCH] fix locals context --- pepper/libpepper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pepper/libpepper.py b/pepper/libpepper.py index 482810c..ce67e8c 100644 --- a/pepper/libpepper.py +++ b/pepper/libpepper.py @@ -447,13 +447,14 @@ def login(self, username=None, password=None, eauth=None, **kwargs): authentication token or an empty dict ''' + local = locals() kwargs.update( dict( - (key, locals()[key]) for key in ( + (key, local[key]) for key in ( 'username', 'password', 'eauth' - ) if locals().get(key, None) is not None + ) if local.get(key, None) is not None ) ) self.auth = self._send_auth('/login', **kwargs).get('return', [{}])[0]