summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-11 22:54:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-13 13:41:32 +0100
commitfce8da957fd2bbf1c3b02dfe34bc18a0bce37d65 (patch)
tree8e269c8576aac8fe7cd284ae3241271340c3d733 /bitbake/lib/prserv
parent9a309684cfff5e1de3dbcc9690fc73d344e63ecd (diff)
downloadpoky-fce8da957fd2bbf1c3b02dfe34bc18a0bce37d65.tar.gz
bitbake: daemonize/prserv/tests/fetch: Convert file() -> open()
Use python3 compatible functions. (Bitbake rev: e6a0296ba29c3fbc8417d1df7a01d50562668a41) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv')
-rw-r--r--bitbake/lib/prserv/serv.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index affccd9b3b..8cec9f8870 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -242,8 +242,8 @@ class PRServer(SimpleXMLRPCServer):
242 242
243 sys.stdout.flush() 243 sys.stdout.flush()
244 sys.stderr.flush() 244 sys.stderr.flush()
245 si = file('/dev/null', 'r') 245 si = open('/dev/null', 'r')
246 so = file(self.logfile, 'a+') 246 so = open(self.logfile, 'a+')
247 se = so 247 se = so
248 os.dup2(si.fileno(),sys.stdin.fileno()) 248 os.dup2(si.fileno(),sys.stdin.fileno())
249 os.dup2(so.fileno(),sys.stdout.fileno()) 249 os.dup2(so.fileno(),sys.stdout.fileno())
@@ -263,7 +263,7 @@ class PRServer(SimpleXMLRPCServer):
263 263
264 # write pidfile 264 # write pidfile
265 pid = str(os.getpid()) 265 pid = str(os.getpid())
266 pf = file(self.pidfile, 'w') 266 pf = open(self.pidfile, 'w')
267 pf.write("%s\n" % pid) 267 pf.write("%s\n" % pid)
268 pf.close() 268 pf.close()
269 269
@@ -323,7 +323,7 @@ def start_daemon(dbfile, host, port, logfile):
323 ip = socket.gethostbyname(host) 323 ip = socket.gethostbyname(host)
324 pidfile = PIDPREFIX % (ip, port) 324 pidfile = PIDPREFIX % (ip, port)
325 try: 325 try:
326 pf = file(pidfile,'r') 326 pf = open(pidfile,'r')
327 pid = int(pf.readline().strip()) 327 pid = int(pf.readline().strip())
328 pf.close() 328 pf.close()
329 except IOError: 329 except IOError:
@@ -350,7 +350,7 @@ def stop_daemon(host, port):
350 ip = socket.gethostbyname(host) 350 ip = socket.gethostbyname(host)
351 pidfile = PIDPREFIX % (ip, port) 351 pidfile = PIDPREFIX % (ip, port)
352 try: 352 try:
353 pf = file(pidfile,'r') 353 pf = open(pidfile,'r')
354 pid = int(pf.readline().strip()) 354 pid = int(pf.readline().strip())
355 pf.close() 355 pf.close()
356 except IOError: 356 except IOError: