diff --git a/docs/source/news.rst b/docs/source/news.rst index 3d90aead..8f61b9c8 100644 --- a/docs/source/news.rst +++ b/docs/source/news.rst @@ -2,6 +2,13 @@ Changelog ========= +19.x / not released +=================== + +- fix: prevent raising :exc:`AttributeError` when ``--reload`` is not passed + in case of a :exc:`SyntaxError` raised from the WSGI application. + (:issue:`1805`, :pr:`1806`) + 19.8.1 / 2018/04/30 =================== diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py index ce40796f..881efa0f 100644 --- a/gunicorn/workers/base.py +++ b/gunicorn/workers/base.py @@ -137,7 +137,7 @@ class Worker(object): try: self.wsgi = self.app.wsgi() except SyntaxError as e: - if self.cfg.reload == 'off': + if not self.cfg.reload: raise self.log.exception(e)