summaryrefslogtreecommitdiffstats
path: root/SCons/Job.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-10-08 13:32:17 (GMT)
committerMats Wichmann <mats@linux.com>2021-10-08 13:37:01 (GMT)
commitc70ce59e8402272a077601b951b7a464d74cc807 (patch)
tree213c0d39a0151e528e26b2b55574676235fd81c4 /SCons/Job.py
parent43f775a78f1d78515654e72c1280b074fd4c1899 (diff)
downloadSCons-c70ce59e8402272a077601b951b7a464d74cc807.zip
SCons-c70ce59e8402272a077601b951b7a464d74cc807.tar.gz
SCons-c70ce59e8402272a077601b951b7a464d74cc807.tar.bz2
Update Job module to use thread.daemon
Replaces call to deprecated thread.setDaemon. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Job.py')
-rw-r--r--SCons/Job.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/SCons/Job.py b/SCons/Job.py
index f87a3bb..381b27a 100644
--- a/SCons/Job.py
+++ b/SCons/Job.py
@@ -33,6 +33,7 @@ import os
import signal
import SCons.Errors
+import SCons.Warnings
# The default stack size (in kilobytes) of the threads used to execute
# jobs in parallel.
@@ -139,7 +140,7 @@ class Jobs:
self.job.taskmaster.stop()
self.job.interrupted.set()
else:
- os._exit(2)
+ os._exit(2) # pylint: disable=protected-access
self.old_sigint = signal.signal(signal.SIGINT, handler)
self.old_sigterm = signal.signal(signal.SIGTERM, handler)
@@ -231,7 +232,7 @@ else:
def __init__(self, requestQueue, resultsQueue, interrupted):
threading.Thread.__init__(self)
- self.setDaemon(1)
+ self.daemon = True
self.requestQueue = requestQueue
self.resultsQueue = resultsQueue
self.interrupted = interrupted
@@ -389,7 +390,7 @@ else:
if task.needs_execute():
# dispatch task
self.tp.put(task)
- jobs = jobs + 1
+ jobs += 1
else:
task.executed()
task.postprocess()
@@ -400,7 +401,7 @@ else:
# back and put the next batch of tasks on the queue.
while True:
task, ok = self.tp.get()
- jobs = jobs - 1
+ jobs -= 1
if ok:
task.executed()