Skip to content

Commit

Permalink
lint: inotify reloader does not access undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Aug 12, 2024
1 parent 7eadeb9 commit 0bff3a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gunicorn/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@ def run(self):


has_inotify = False
inotify = None # inotify.adapters
Inotify = None # inotify.adapters.Inotify
if sys.platform.startswith('linux'):
try:
import inotify.constants as _
from inotify.adapters import Inotify
import inotify.constants
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 0bff3a1

Please sign in to comment.