summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv
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/prserv
parentef1df516512587ad415f76a9626620992d660e45 (diff)
downloadpoky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz
poky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.bz2
poky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.zip
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/prserv')
-rw-r--r--bitbake/lib/prserv/db.py2
-rw-r--r--bitbake/lib/prserv/serv.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
index 2a86184170..495d09f39b 100644
--- a/bitbake/lib/prserv/db.py
+++ b/bitbake/lib/prserv/db.py
@@ -260,7 +260,7 @@ class PRData(object):
self.connection.close()
def __getitem__(self,tblname):
- if not isinstance(tblname, basestring):
+ if not isinstance(tblname, str):
raise TypeError("tblname argument must be a string, not '%s'" %
type(tblname))
if tblname in self._tables:
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index 8cec9f8870..cafcc820cd 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -1,10 +1,10 @@
import os,sys,logging
import signal, time
-from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import threading
-import Queue
+import queue
import socket
-import StringIO
+import io
try:
import sqlite3
@@ -64,7 +64,7 @@ class PRServer(SimpleXMLRPCServer):
self.register_function(self.importone, "importone")
self.register_introspection_functions()
- self.requestqueue = Queue.Queue()
+ self.requestqueue = queue.Queue()
self.handlerthread = threading.Thread(target = self.process_request_thread)
self.handlerthread.daemon = False
@@ -83,7 +83,7 @@ class PRServer(SimpleXMLRPCServer):
while not self.quit:
try:
(request, client_address) = self.requestqueue.get(True, 30)
- except Queue.Empty:
+ except queue.Empty:
self.table.sync_if_dirty()
continue
try:
@@ -126,7 +126,7 @@ class PRServer(SimpleXMLRPCServer):
Returns None if the database engine does not support dumping to
script or if some other error is encountered in processing.
"""
- buff = StringIO.StringIO()
+ buff = io.StringIO()
try:
self.table.sync()
self.table.dump_db(buff)
@@ -420,7 +420,7 @@ class PRServiceConfigError(Exception):
def auto_start(d):
global singleton
- host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':'))
+ host_params = list(filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':')))
if not host_params:
return None