From 20616d50fcdb066adba3a5afa9a6a692dbc7cc4b Mon Sep 17 00:00:00 2001 From: Benno Rice Date: Wed, 24 May 2017 21:13:02 -0700 Subject: [PATCH] Move a default class definition into an else block so we're not redefining. --- gunicorn/reloader.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index 627273cf..b1ce743f 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -63,11 +63,6 @@ if sys.platform.startswith('linux'): pass -class InotifyReloader(): - def __init__(self, callback=None): - raise ImportError('You must have the inotify module installed to use ' - 'the inotify reloader') - if has_inotify: class InotifyReloader(threading.Thread): @@ -118,6 +113,13 @@ if has_inotify: self._callback(filename) +else: + + class InotifyReloader(object): + def __init__(self, callback=None): + raise ImportError('You must have the inotify module installed to ' + 'use the inotify reloader') + preferred_reloader = InotifyReloader if has_inotify else Reloader