From be6834fe527823a64269c5ab1107af4c97882a44 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 2 Apr 2020 22:35:04 +0200 Subject: avoid changing variable types The mypy type checker deals badly when a binding changes its type. To ease porting to mypy, avoid changing the type of variables. In some cases, variables can be eliminated. In other cases, they are renamed. --- wsgitools/filters.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'wsgitools/filters.py') diff --git a/wsgitools/filters.py b/wsgitools/filters.py index 60e4ebb..2a97066 100644 --- a/wsgitools/filters.py +++ b/wsgitools/filters.py @@ -388,8 +388,7 @@ class GzipWSGIFilter(BaseWSGIFilter): assert isinstance(environ, dict) if "HTTP_ACCEPT_ENCODING" in environ: acceptenc = environ["HTTP_ACCEPT_ENCODING"].split(',') - acceptenc = map(str.strip, acceptenc) - if "gzip" in acceptenc: + if "gzip" in map(str.strip, acceptenc): self.compress = True self.sio = io.BytesIO() self.gzip = gzip.GzipFile(fileobj=self.sio, mode="w") -- cgit v1.2.3