Update routing.py

Compare id
This commit is contained in:
Javier Sánchez Castro 2024-04-11 23:36:58 +01:00 committed by GitHub
parent 8a0a360505
commit e0771b7f25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1204,7 +1204,7 @@ class APIRouter(routing.Router):
app.include_router(internal_router)
```
"""
assert self != router, "Router cannot be the same as parent"
assert id(self) != id(router), "Router cannot be the same as parent"
if prefix:
assert prefix.startswith("/"), "A path prefix must start with '/'"
assert not prefix.endswith(