From 516f661a38e2ebceb7d32ee096f209edcbf5177b Mon Sep 17 00:00:00 2001 From: Channel Cat Date: Sun, 16 Oct 2016 00:52:39 -0700 Subject: [PATCH] Removed unreachable code and old middleware class --- sanic/middleware.py | 4 ---- sanic/sanic.py | 7 ------- 2 files changed, 11 deletions(-) delete mode 100644 sanic/middleware.py diff --git a/sanic/middleware.py b/sanic/middleware.py deleted file mode 100644 index d19a0288..00000000 --- a/sanic/middleware.py +++ /dev/null @@ -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 diff --git a/sanic/sanic.py b/sanic/sanic.py index f7ed0dc0..aff7188c 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -1,12 +1,10 @@ import asyncio from inspect import isawaitable from traceback import format_exc -from types import FunctionType from .config import Config from .exceptions import Handler from .log import log, logging -from .middleware import Middleware from .response import HTTPResponse from .router import Router from .server import serve @@ -80,11 +78,6 @@ class Sanic: attach_to = args[0] return register_middleware - if isinstance(middleware, FunctionType): - middleware = Middleware(process_request=middleware) - - return middleware - # -------------------------------------------------------------------- # # Request Handling # -------------------------------------------------------------------- #