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