From 3238aec55aec06a2b7187927fa24d5fe6a9ab594 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Sun, 8 Aug 2021 04:29:41 -0500 Subject: [PATCH] Move reset to the front of copy method. --- sanic/blueprints.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sanic/blueprints.py b/sanic/blueprints.py index 248c7872..d8520f99 100644 --- a/sanic/blueprints.py +++ b/sanic/blueprints.py @@ -91,15 +91,6 @@ class Blueprint(BaseSanic): self.version = version self.version_prefix = version_prefix - def reset(self): - self._apps: Set[Sanic] = set() - self.exceptions: List[RouteHandler] = [] - self.listeners: Dict[str, List[ListenerType]] = {} - self.middlewares: List[MiddlewareType] = [] - self.routes: List[Route] = [] - self.statics: List[RouteHandler] = [] - self.websocket_routes: List[Route] = [] - def __repr__(self) -> str: args = ", ".join( [ @@ -149,6 +140,15 @@ class Blueprint(BaseSanic): kwargs["apply"] = False return super().signal(event, *args, **kwargs) + def reset(self): + self._apps: Set[Sanic] = set() + self.exceptions: List[RouteHandler] = [] + self.listeners: Dict[str, List[ListenerType]] = {} + self.middlewares: List[MiddlewareType] = [] + self.routes: List[Route] = [] + self.statics: List[RouteHandler] = [] + self.websocket_routes: List[Route] = [] + def copy( self, name: str,