From fc7c15abbd2d7476580297ad1b5c2822dae9da14 Mon Sep 17 00:00:00 2001 From: Peter VandeHaar Date: Wed, 12 Jul 2017 05:55:48 -0400 Subject: [PATCH] Only use inotify on linux (#1541) Fixes #1540 --- gunicorn/reloader.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index 4a4dae49..627273cf 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -53,12 +53,14 @@ class Reloader(threading.Thread): self._callback(filename) time.sleep(self._interval) -try: - from inotify.adapters import Inotify - import inotify.constants - has_inotify = True -except ImportError: - has_inotify = False +has_inotify = False +if sys.platform.startswith('linux'): + try: + from inotify.adapters import Inotify + import inotify.constants + has_inotify = True + except ImportError: + pass class InotifyReloader():