recovery the flask8 error

This commit is contained in:
lizheao 2017-04-27 18:03:13 +08:00
parent 65d80ec11b
commit 28bdac46f6

View File

@ -99,7 +99,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 " raise SanicTypeException("You can`t add a instance "
"method as a blueprint router handler") "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
@ -129,7 +130,8 @@ class Blueprint:
methods = handler.handlers.keys() methods = handler.handlers.keys()
if isinstance(handler, MethodType): if isinstance(handler, MethodType):
raise SanicTypeException("You can`t add a " raise SanicTypeException("You can`t add a "
"instance method as a blueprint router handler") "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)