diff --git a/flask/config.py b/flask/config.py index 697add71..c4b56f72 100644 --- a/flask/config.py +++ b/flask/config.py @@ -14,6 +14,7 @@ import types import errno from werkzeug.utils import import_string + from ._compat import string_types, iteritems from . import json diff --git a/flask/exthook.py b/flask/exthook.py index d8842802..8cceef55 100644 --- a/flask/exthook.py +++ b/flask/exthook.py @@ -22,6 +22,7 @@ import sys import os import warnings + from ._compat import reraise diff --git a/flask/globals.py b/flask/globals.py index 0b70a3ef..ab140f15 100644 --- a/flask/globals.py +++ b/flask/globals.py @@ -11,6 +11,7 @@ """ from functools import partial + from werkzeug.local import LocalStack, LocalProxy diff --git a/flask/helpers.py b/flask/helpers.py index 828f5840..2ee0b5d8 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -18,7 +18,6 @@ from time import time from zlib import adler32 from threading import RLock import unicodedata -from werkzeug.routing import BuildError from functools import update_wrapper try: @@ -26,6 +25,7 @@ try: except ImportError: from urlparse import quote as url_quote +from werkzeug.routing import BuildError from werkzeug.datastructures import Headers, Range from werkzeug.exceptions import BadRequest, NotFound, \ RequestedRangeNotSatisfiable diff --git a/flask/json.py b/flask/json.py index bf8a8843..430e458f 100644 --- a/flask/json.py +++ b/flask/json.py @@ -11,17 +11,16 @@ import io import uuid from datetime import date -from .globals import current_app, request -from ._compat import text_type, PY2 -from .ctx import has_request_context from werkzeug.http import http_date from jinja2 import Markup - # Use the same json implementation as itsdangerous on which we # depend anyways. from itsdangerous import json as _json +from .globals import current_app, request +from ._compat import text_type, PY2 +from .ctx import has_request_context # Figure out if simplejson escapes slashes. This behavior was changed # from one version to another without reason. diff --git a/flask/logging.py b/flask/logging.py index 3f888a75..e263452b 100644 --- a/flask/logging.py +++ b/flask/logging.py @@ -12,10 +12,11 @@ from __future__ import absolute_import import sys - -from werkzeug.local import LocalProxy from logging import getLogger, StreamHandler, Formatter, getLoggerClass, \ DEBUG, ERROR + +from werkzeug.local import LocalProxy + from .globals import _request_ctx_stack diff --git a/flask/sessions.py b/flask/sessions.py index 525ff246..5b7b9c2e 100644 --- a/flask/sessions.py +++ b/flask/sessions.py @@ -13,14 +13,15 @@ import uuid import hashlib from base64 import b64encode, b64decode from datetime import datetime + from werkzeug.http import http_date, parse_date from werkzeug.datastructures import CallbackDict +from itsdangerous import URLSafeTimedSerializer, BadSignature + from . import Markup, json from ._compat import iteritems, text_type from .helpers import total_seconds -from itsdangerous import URLSafeTimedSerializer, BadSignature - class SessionMixin(object): """Expands a basic dictionary with an accessors that are expected diff --git a/flask/testing.py b/flask/testing.py index 31600245..9fe69bdb 100644 --- a/flask/testing.py +++ b/flask/testing.py @@ -10,9 +10,11 @@ :license: BSD, see LICENSE for more details. """ -import werkzeug from contextlib import contextmanager + +import werkzeug from werkzeug.test import Client, EnvironBuilder + from flask import _request_ctx_stack try: