Move a default class definition into an else block so we're not redefining.

This commit is contained in:
Benno Rice 2017-05-24 21:13:02 -07:00 committed by Berker Peksag
parent a4461ba158
commit 20616d50fc

View File

@ -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