Skip to content

Commit

Permalink
Fix deprecation warning by using is_set
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Mar 4, 2024
1 parent d401eaf commit 82d987b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/nav/ipdevpoll/jobs.py
Expand Up @@ -67,7 +67,6 @@ def __init__(self, msg=None, cause=None, delay=60):


class JobHandler(object):

"""Handles a single polling job against a single netbox.
An instance of this class performs a polling job, as described by
Expand Down Expand Up @@ -191,7 +190,7 @@ def _get_willing_plugins(self, plugin_classes):
else:
unwilling_plugins.append(cls)

for (willingness, plugins) in [
for willingness, plugins in [
('unwilling', unwilling_plugins),
('willing', willing_plugins),
]:
Expand Down Expand Up @@ -319,7 +318,7 @@ def log_abort(failure):
return failure

def save(result):
if self.cancelled.isSet():
if self.cancelled.is_set():
return wrap_up_job(result)

df = self._save_container()
Expand Down Expand Up @@ -524,7 +523,7 @@ def _container_factory(self, container_class, key, *args, **kwargs):

def _raise_if_cancelled(self):
"""Raises an AbortedJobError if the current job is cancelled"""
if self.cancelled.isSet():
if self.cancelled.is_set():
raise AbortedJobError("Job was already cancelled")

@classmethod
Expand Down

0 comments on commit 82d987b

Please sign in to comment.