diff --git a/src/flask/cli.py b/src/flask/cli.py index f7e1f29353..d2677aa564 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -302,7 +302,7 @@ def load_app(self) -> Flask: else: if self.app_import_path: path, name = ( - re.split(r":(?![\\/])", self.app_import_path, 1) + [None] + re.split(r":(?![\\/])", self.app_import_path, maxsplit=1) + [None] )[:2] import_name = prepare_import(path) app = locate_app(import_name, name)