[PATCH 39 of 52 Narval cube] [autopep8] E731 - Use a def when use do not assign a lambda expression

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 11:34:39 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585460444 0
#      Sun Mar 29 05:40:44 2020 +0000
# Node ID 3b23f39884eb4c3da309120f7d259c709a3cc646
# Parent  8530a5bb66a5865dab438ede429cda6eefa30ca9
[autopep8] E731 - Use a def when use do not assign a lambda expression

diff --git a/cubicweb_narval/narvalbot/__init__.py b/cubicweb_narval/narvalbot/__init__.py
--- a/cubicweb_narval/narvalbot/__init__.py
+++ b/cubicweb_narval/narvalbot/__init__.py
@@ -280,7 +280,7 @@
         headers_to_sign = ('Content-MD5', 'Content-Type', 'Date')
         method = req.method
         url = req.url
-        get_header = lambda field: req.headers.get(field, '')
+        def get_header(field): return req.headers.get(field, '')
         to_sign = method + url + ''.join(map(get_header, headers_to_sign))
         return hmac.new(self.token, to_sign).hexdigest()
 




More information about the cubicweb-devel mailing list