diff --git a/python/nav/ipdevpoll/jobs.py b/python/nav/ipdevpoll/jobs.py index 0f80f8cdaf..4de0afb035 100644 --- a/python/nav/ipdevpoll/jobs.py +++ b/python/nav/ipdevpoll/jobs.py @@ -319,7 +319,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() @@ -524,7 +524,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 diff --git a/python/nav/statemon/db.py b/python/nav/statemon/db.py index 6a692b7525..32869eb9c7 100644 --- a/python/nav/statemon/db.py +++ b/python/nav/statemon/db.py @@ -73,7 +73,7 @@ class _DB(threading.Thread): def __init__(self): threading.Thread.__init__(self) - self.setDaemon(1) + self.daemon = True self.queue = queue.Queue() self._hosts_to_ping = [] self._checkers = []