Removed unreachable code and old middleware class

This commit is contained in:
Channel Cat 2016-10-16 00:52:39 -07:00
parent 41d31b9e55
commit 516f661a38
2 changed files with 0 additions and 11 deletions

View File

@ -1,4 +0,0 @@
class Middleware:
def __init__(self, process_request=None, process_response=None):
self.process_request = process_request
self.process_response = process_response

View File

@ -1,12 +1,10 @@
import asyncio import asyncio
from inspect import isawaitable from inspect import isawaitable
from traceback import format_exc from traceback import format_exc
from types import FunctionType
from .config import Config from .config import Config
from .exceptions import Handler from .exceptions import Handler
from .log import log, logging from .log import log, logging
from .middleware import Middleware
from .response import HTTPResponse from .response import HTTPResponse
from .router import Router from .router import Router
from .server import serve from .server import serve
@ -80,11 +78,6 @@ class Sanic:
attach_to = args[0] attach_to = args[0]
return register_middleware return register_middleware
if isinstance(middleware, FunctionType):
middleware = Middleware(process_request=middleware)
return middleware
# -------------------------------------------------------------------- # # -------------------------------------------------------------------- #
# Request Handling # Request Handling
# -------------------------------------------------------------------- # # -------------------------------------------------------------------- #