Fix if statement logic

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
This commit is contained in:
Zhiwei 2021-08-07 16:03:58 -05:00 committed by GitHub
parent 54cee45d06
commit 9c8f2c619a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,8 +201,8 @@ class Blueprint(BaseSanic):
for key, value in attrs_backup.items():
setattr(self, key, value)
if with_registration:
if len(new_bp._future_statics) > 0 and len(self._apps) > 0:
if with_registration and self._apps:
if new_bp._future_statics:
raise Exception(
"Static routes registered with the old blueprint instance,"
" cannot be registered again."