From 9c8f2c619a59f167cee61274dfde6f13e79e08d6 Mon Sep 17 00:00:00 2001 From: Zhiwei Date: Sat, 7 Aug 2021 16:03:58 -0500 Subject: [PATCH] Fix if statement logic Co-authored-by: Adam Hopkins --- sanic/blueprints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/blueprints.py b/sanic/blueprints.py index bd029c3b..6307d3fa 100644 --- a/sanic/blueprints.py +++ b/sanic/blueprints.py @@ -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."