Skip to content

Commit

Permalink
lint: split availability testing from usage
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Aug 12, 2024
1 parent f5f41fe commit 7eadeb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gunicorn/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ def run(self):
has_inotify = False
if sys.platform.startswith('linux'):
try:
from inotify.adapters import Inotify
import inotify.constants
import inotify.constants as _
has_inotify = True
except ImportError:
pass


if has_inotify:
from inotify.adapters import Inotify
import inotify.constants

class InotifyReloader(threading.Thread):
event_mask = (inotify.constants.IN_CREATE | inotify.constants.IN_DELETE
Expand Down

0 comments on commit 7eadeb9

Please sign in to comment.