recovery the flask8 error

This commit is contained in:
lizheao 2017-04-27 17:59:22 +08:00
parent 240f5b7c9f
commit 65d80ec11b

View File

@ -98,7 +98,8 @@ class Blueprint:
def decorator(handler): def decorator(handler):
if isinstance(handler, MethodType): if isinstance(handler, MethodType):
raise SanicTypeException("You can`t add a instance method as a blueprint router hander") raise SanicTypeException("You can`t add a instance "
"method as a blueprint router handler")
route = FutureRoute(handler, uri, methods, host, strict_slashes) route = FutureRoute(handler, uri, methods, host, strict_slashes)
self.routes.append(route) self.routes.append(route)
return handler return handler
@ -127,7 +128,8 @@ class Blueprint:
if isinstance(handler, CompositionView): if isinstance(handler, CompositionView):
methods = handler.handlers.keys() methods = handler.handlers.keys()
if isinstance(handler, MethodType): if isinstance(handler, MethodType):
raise SanicTypeException("You can`t add a instance method as a blueprint router hander") raise SanicTypeException("You can`t add a "
"instance method as a blueprint router handler")
self.route(uri=uri, methods=methods, host=host, self.route(uri=uri, methods=methods, host=host,
strict_slashes=strict_slashes)(handler) strict_slashes=strict_slashes)(handler)