diff --git a/applications/admin/controllers/appadmin.py b/applications/admin/controllers/appadmin.py index 6b3a8370..2f780749 100644 --- a/applications/admin/controllers/appadmin.py +++ b/applications/admin/controllers/appadmin.py @@ -576,7 +576,7 @@ def bg_graph_model(): meta_graphmodel = dict(group=request.application, color='#ECECEC') group = meta_graphmodel['group'].replace(' ', '') - if not subgraphs.has_key(group): + if group not in subgraphs: subgraphs[group] = dict(meta=meta_graphmodel, tables=[]) subgraphs[group]['tables'].append(tablename) diff --git a/applications/admin/views/default/design.html b/applications/admin/views/default/design.html index 2d918b83..cd6d60f8 100644 --- a/applications/admin/views/default/design.html +++ b/applications/admin/views/default/design.html @@ -207,7 +207,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi {{=peekfile('views',c, dict(id=id))}} - {{if extend.has_key(c):}}{{=T("extends")}} {{=extend[c]}} {{pass}} + {{if c in extend:}}{{=T("extends")}} {{=extend[c]}} {{pass}} {{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(', '.join([B(f).xml() for f in include[c]]))}} diff --git a/applications/admin/views/default/plugin.html b/applications/admin/views/default/plugin.html index 0fd8ea1a..a0c5a2d4 100644 --- a/applications/admin/views/default/plugin.html +++ b/applications/admin/views/default/plugin.html @@ -144,7 +144,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi {{=peekfile('views',c)}} - {{if extend.has_key(c):}}{{=T("extends")}} {{=extend[c]}} {{pass}} + {{if c in extend:}}{{=T("extends")}} {{=extend[c]}} {{pass}} {{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(', '.join([B(f).xml() for f in include[c]]))}} diff --git a/applications/examples/controllers/appadmin.py b/applications/examples/controllers/appadmin.py index 6b3a8370..2f780749 100644 --- a/applications/examples/controllers/appadmin.py +++ b/applications/examples/controllers/appadmin.py @@ -576,7 +576,7 @@ def bg_graph_model(): meta_graphmodel = dict(group=request.application, color='#ECECEC') group = meta_graphmodel['group'].replace(' ', '') - if not subgraphs.has_key(group): + if group not in subgraphs: subgraphs[group] = dict(meta=meta_graphmodel, tables=[]) subgraphs[group]['tables'].append(tablename) diff --git a/applications/welcome/controllers/appadmin.py b/applications/welcome/controllers/appadmin.py index 6b3a8370..2f780749 100644 --- a/applications/welcome/controllers/appadmin.py +++ b/applications/welcome/controllers/appadmin.py @@ -576,7 +576,7 @@ def bg_graph_model(): meta_graphmodel = dict(group=request.application, color='#ECECEC') group = meta_graphmodel['group'].replace(' ', '') - if not subgraphs.has_key(group): + if group not in subgraphs: subgraphs[group] = dict(meta=meta_graphmodel, tables=[]) subgraphs[group]['tables'].append(tablename) diff --git a/gluon/html.py b/gluon/html.py index 7177a743..85f9c43b 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -2643,7 +2643,7 @@ def test(): >>> form=FORM(INPUT(value="Hello World", _name="var", requires=IS_MATCH('^\w+$'))) >>> isinstance(form.as_dict(), dict) True - >>> form.as_dict(flat=True).has_key("vars") + >>> "vars" in form.as_dict(flat=True) True >>> isinstance(form.as_json(), basestring) and len(form.as_json(sanitize=False)) > 0 True diff --git a/gluon/tools.py b/gluon/tools.py index 76a3fa81..25a2c135 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -4219,7 +4219,7 @@ class Auth(object): if resolve: if slug: wiki = self._wiki.read(slug, force_render) - if isinstance(wiki, dict) and wiki.has_key('content'): # FIXME: .has_key() is deprecated + if isinstance(wiki, dict) and 'content' in wiki: # We don't want to return a dict object, just the wiki wiki = wiki['content'] else: @@ -5239,7 +5239,7 @@ class Service(object): def return_error(id, code, message=None, data=None): error = {'code': code} - if Service.jsonrpc_errors.has_key(code): + if code in Service.jsonrpc_errors: error['message'] = Service.jsonrpc_errors[code][0] error['data'] = Service.jsonrpc_errors[code][1] if message is not None: diff --git a/web2py.py b/web2py.py index 42ec1c22..907236b7 100755 --- a/web2py.py +++ b/web2py.py @@ -24,7 +24,7 @@ if __name__ == '__main__': freeze_support() except: sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n') - if os.environ.has_key("COVERAGE_PROCESS_START"): + if "COVERAGE_PROCESS_START" in os.environ: try: import coverage coverage.process_startup()