Skip to content

Commit

Permalink
Remove nested methods artifact (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Mar 4, 2021
1 parent 0691e9f commit fcb4d0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sanic_routing/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_handler(self, raw_path, method, idx):
raise self.router.method_handler_exception(
f"Method '{method}' not found on {self}",
method=method,
allowed_methods=set(self.methods[raw_path]),
allowed_methods=self.methods,
)

def add_handler(self, raw_path, handler, method, requirements):
Expand Down Expand Up @@ -162,9 +162,9 @@ def _finalize_params(self):
self.params = params

def _finalize_methods(self):
self.methods = {}
for path, handlers in self.handlers.items():
self.methods[path] = set(key.upper() for key in handlers.keys())
self.methods = set()
for handlers in self.handlers.values():
self.methods.update(set(key.upper() for key in handlers.keys()))

def _finalize_handlers(self):
self.handlers = Immutable(self.handlers)
Expand Down

0 comments on commit fcb4d0f

Please sign in to comment.