From 02e0cd187ae364a56efd9e3133fdc7780942364b Mon Sep 17 00:00:00 2001 From: ilvalle Date: Sun, 29 May 2016 08:26:35 +0200 Subject: [PATCH] running lib2to3.fixes.fix_has_key --- gluon/contrib/gateways/fcgi.py | 8 ++++---- gluon/contrib/markdown/__init__.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gluon/contrib/gateways/fcgi.py b/gluon/contrib/gateways/fcgi.py index f27fe012..239b13cb 100644 --- a/gluon/contrib/gateways/fcgi.py +++ b/gluon/contrib/gateways/fcgi.py @@ -1156,7 +1156,7 @@ class WSGIServer(Server): Set multithreaded to False if your application is not MT-safe. """ - if kw.has_key('handler'): + if 'handler' in kw: del kw['handler'] # Doesn't make sense to let this through super(WSGIServer, self).__init__(**kw) @@ -1284,9 +1284,9 @@ class WSGIServer(Server): def _sanitizeEnv(self, environ): """Ensure certain values are present, if required by WSGI.""" - if not environ.has_key('SCRIPT_NAME'): + if 'SCRIPT_NAME' not in environ: environ['SCRIPT_NAME'] = '' - if not environ.has_key('PATH_INFO'): + if 'PATH_INFO' not in environ: environ['PATH_INFO'] = '' # If any of these are missing, it probably signifies a broken @@ -1295,7 +1295,7 @@ class WSGIServer(Server): ('SERVER_NAME', 'localhost'), ('SERVER_PORT', '80'), ('SERVER_PROTOCOL', 'HTTP/1.0')]: - if not environ.has_key(name): + if name not in environ: environ['wsgi.errors'].write('%s: missing FastCGI param %s ' 'required by WSGI!\n' % (self.__class__.__name__, name)) diff --git a/gluon/contrib/markdown/__init__.py b/gluon/contrib/markdown/__init__.py index 469c0b44..e945876f 100644 --- a/gluon/contrib/markdown/__init__.py +++ b/gluon/contrib/markdown/__init__.py @@ -4,7 +4,7 @@ from gluon.html import XML def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False, **attributes): if not text: test = '' - if attributes.has_key('extras'): + if 'extras' in attributes: extras = attributes['extras'] del attributes['extras'] else: