Remove useless lines, noused import and variable

This commit is contained in:
fydot 2015-09-03 01:46:42 +08:00 committed by Ben Darnell
parent 47c0dfa563
commit bbfd096f4f
5 changed files with 9 additions and 7 deletions

View File

@ -373,6 +373,7 @@ def run_on_executor(*args, **kwargs):
def run_on_executor_decorator(fn):
executor = kwargs.get("executor", "executor")
io_loop = kwargs.get("io_loop", "io_loop")
@functools.wraps(fn)
def wrapper(self, *args, **kwargs):
callback = kwargs.pop("callback", None)

View File

@ -106,7 +106,8 @@ except ImportError:
try:
from inspect import isawaitable # py35+
except ImportError:
def isawaitable(x): return False
def isawaitable(x):
return False
try:
import builtins # py3
@ -222,6 +223,7 @@ def _make_coroutine_wrapper(func, replace_callback):
# to be used with 'await'.
if hasattr(types, 'coroutine'):
func = types.coroutine(func)
@functools.wraps(func)
def wrapper(*args, **kwargs):
future = TracebackFuture()

View File

@ -61,6 +61,7 @@ _supported_locales = frozenset([_default_locale])
_use_gettext = False
CONTEXT_SEPARATOR = "\x04"
def get(*locale_codes):
"""Returns the closest match for the given locale codes.
@ -504,8 +505,8 @@ class GettextLocale(Locale):
if plural_message is not None:
assert count is not None
msgs_with_ctxt = ("%s%s%s" % (context, CONTEXT_SEPARATOR, message),
"%s%s%s" % (context, CONTEXT_SEPARATOR, plural_message),
count)
"%s%s%s" % (context, CONTEXT_SEPARATOR, plural_message),
count)
result = self.ngettext(*msgs_with_ctxt)
if CONTEXT_SEPARATOR in result:
# Translation not found

View File

@ -40,7 +40,6 @@ import re
import signal
import socket
import sys
import types
try:
from cStringIO import StringIO # py2

View File

@ -649,7 +649,6 @@ class RequestHandler(object):
value = self.get_cookie(name)
return get_signature_key_version(value)
def redirect(self, url, permanent=False, status=None):
"""Sends a redirect to the given (optionally relative) URL.
@ -2010,8 +2009,8 @@ class _RequestDispatcher(httputil.HTTPMessageDelegate):
# except handler, and we cannot easily access the IOLoop here to
# call add_future (because of the requirement to remain compatible
# with WSGI)
f = self.handler._execute(transforms, *self.path_args,
**self.path_kwargs)
self.handler._execute(transforms, *self.path_args,
**self.path_kwargs)
# If we are streaming the request body, then execute() is finished
# when the handler has prepared to receive the body. If not,
# it doesn't matter when execute() finishes (so we return None)