summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-12 08:30:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:02 +0100
commit0f2c59367a649de5f57acdccfb4f1fdba9cde730 (patch)
tree7a3558a3e08e690fbb0b5bdc4044316f9ab4bbcb /bitbake/lib/bb/server/process.py
parentef1df516512587ad415f76a9626620992d660e45 (diff)
downloadpoky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz
bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. (Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index cc58c720a2..982fcf71c3 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -30,7 +30,7 @@ import signal
30import sys 30import sys
31import time 31import time
32import select 32import select
33from Queue import Empty 33from queue import Empty
34from multiprocessing import Event, Process, util, Queue, Pipe, queues, Manager 34from multiprocessing import Event, Process, util, Queue, Pipe, queues, Manager
35 35
36from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer 36from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer
@@ -137,7 +137,7 @@ class ProcessServer(Process, BaseImplServer):
137 if not fds: 137 if not fds:
138 fds = [] 138 fds = []
139 139
140 for function, data in self._idlefuns.items(): 140 for function, data in list(self._idlefuns.items()):
141 try: 141 try:
142 retval = function(self, data, False) 142 retval = function(self, data, False)
143 if retval is False: 143 if retval is False:
@@ -145,7 +145,7 @@ class ProcessServer(Process, BaseImplServer):
145 nextsleep = None 145 nextsleep = None
146 elif retval is True: 146 elif retval is True:
147 nextsleep = None 147 nextsleep = None
148 elif isinstance(retval, float): 148 elif isinstance(retval, float) and nextsleep:
149 if (retval < nextsleep): 149 if (retval < nextsleep):
150 nextsleep = retval 150 nextsleep = retval
151 elif nextsleep is None: 151 elif nextsleep is None:
@@ -213,7 +213,7 @@ class BitBakeProcessServerConnection(BitBakeBaseServerConnection):
213# Wrap Queue to provide API which isn't server implementation specific 213# Wrap Queue to provide API which isn't server implementation specific
214class ProcessEventQueue(multiprocessing.queues.Queue): 214class ProcessEventQueue(multiprocessing.queues.Queue):
215 def __init__(self, maxsize): 215 def __init__(self, maxsize):
216 multiprocessing.queues.Queue.__init__(self, maxsize) 216 multiprocessing.queues.Queue.__init__(self, maxsize, ctx=multiprocessing.get_context())
217 self.exit = False 217 self.exit = False
218 bb.utils.set_process_name("ProcessEQueue") 218 bb.utils.set_process_name("ProcessEQueue")
219 219