Only use inotify on linux (#1541)

Fixes #1540
This commit is contained in:
Peter VandeHaar 2017-07-12 05:55:48 -04:00 committed by Berker Peksag
parent c58560b895
commit fc7c15abbd

View File

@ -53,12 +53,14 @@ class Reloader(threading.Thread):
self._callback(filename) self._callback(filename)
time.sleep(self._interval) time.sleep(self._interval)
try: has_inotify = False
from inotify.adapters import Inotify if sys.platform.startswith('linux'):
import inotify.constants try:
has_inotify = True from inotify.adapters import Inotify
except ImportError: import inotify.constants
has_inotify = False has_inotify = True
except ImportError:
pass
class InotifyReloader(): class InotifyReloader():