From 8f1dada542d9e9cc9af0eada3e99eb7ceda2e873 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 2 Sep 2013 04:57:01 +0600 Subject: [PATCH] Some cleanups --- flask/app.py | 3 +-- flask/debughelpers.py | 2 +- flask/json.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flask/app.py b/flask/app.py index ef2af73c..1ea82fe7 100644 --- a/flask/app.py +++ b/flask/app.py @@ -1158,7 +1158,6 @@ class Flask(_PackageBoundObject): """ self.jinja_env.tests[name or f.__name__] = f - @setupmethod def template_global(self, name=None): """A decorator that is used to register a custom template global function. @@ -1710,7 +1709,7 @@ class Flask(_PackageBoundObject): if bp is not None and bp in self.teardown_request_funcs: funcs = chain(funcs, reversed(self.teardown_request_funcs[bp])) for func in funcs: - rv = func(exc) + func(exc) request_tearing_down.send(self, exc=exc) def do_teardown_appcontext(self, exc=None): diff --git a/flask/debughelpers.py b/flask/debughelpers.py index 2f8510f9..019f0d7e 100644 --- a/flask/debughelpers.py +++ b/flask/debughelpers.py @@ -78,7 +78,7 @@ def attach_enctype_error_multidict(request): def __getitem__(self, key): try: return oldcls.__getitem__(self, key) - except KeyError as e: + except KeyError: if key not in request.form: raise raise DebugFilesKeyError(request, key) diff --git a/flask/json.py b/flask/json.py index 45ba3240..81c6deec 100644 --- a/flask/json.py +++ b/flask/json.py @@ -232,7 +232,7 @@ def jsonify(*args, **kwargs): """ indent = None if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] \ - and not request.is_xhr: + and not request.is_xhr: indent = 2 return current_app.response_class(dumps(dict(*args, **kwargs), indent=indent),