From 037b286eb81dba0b6604dc06f70c07670cc3156f Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Wed, 4 May 2022 12:40:50 +0100 Subject: [PATCH] Fix for running in pythonw --- sanic/mixins/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/mixins/runner.py b/sanic/mixins/runner.py index 1df77e551e..30645b2b1d 100644 --- a/sanic/mixins/runner.py +++ b/sanic/mixins/runner.py @@ -424,7 +424,7 @@ def _helper( self.motd(self.serve_location) - if sys.stdout.isatty() and not self.state.is_debug: + if sys.stdout and sys.stdout.isatty() and not self.state.is_debug: error_logger.warning( f"{Colors.YELLOW}Sanic is running in PRODUCTION mode. " "Consider using '--debug' or '--dev' while actively "