From d96f1f32b3db63c12749844301810fd35581aca4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 11 Dec 2018 14:08:21 +0100 Subject: [PATCH] Fix grammar with assertion message (#266) It should probably also not be an `assert` in the first place (which might be optimized out)?! --- starlette/routing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/starlette/routing.py b/starlette/routing.py index 01a2bc50..7ea80e18 100644 --- a/starlette/routing.py +++ b/starlette/routing.py @@ -149,7 +149,7 @@ class Route(BaseRoute): name: str = None, include_in_schema: bool = True ) -> None: - assert path.startswith("/"), "Routed paths must always start '/'" + assert path.startswith("/"), "Routed paths must start with '/'" self.path = path self.endpoint = endpoint self.name = get_name(endpoint) if name is None else name @@ -218,7 +218,7 @@ class WebSocketRoute(BaseRoute): def __init__( self, path: str, endpoint: typing.Callable, *, name: str = None ) -> None: - assert path.startswith("/"), "Routed paths must always start '/'" + assert path.startswith("/"), "Routed paths must start with '/'" self.path = path self.endpoint = endpoint self.name = get_name(endpoint) if name is None else name @@ -275,7 +275,7 @@ class WebSocketRoute(BaseRoute): class Mount(BaseRoute): def __init__(self, path: str, app: ASGIApp, name: str = None) -> None: - assert path == "" or path.startswith("/"), "Routed paths must always start '/'" + assert path == "" or path.startswith("/"), "Routed paths must start with '/'" self.path = path.rstrip("/") self.app = app self.name = name