diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-11 22:54:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:32 +0100 |
commit | fce8da957fd2bbf1c3b02dfe34bc18a0bce37d65 (patch) | |
tree | 8e269c8576aac8fe7cd284ae3241271340c3d733 /bitbake/lib | |
parent | 9a309684cfff5e1de3dbcc9690fc73d344e63ecd (diff) | |
download | openembedded-core-contrib-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')
-rw-r--r-- | bitbake/lib/bb/daemonize.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 2 | ||||
-rw-r--r-- | bitbake/lib/prserv/serv.py | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/daemonize.py b/bitbake/lib/bb/daemonize.py index 346a618582..ab4a954622 100644 --- a/bitbake/lib/bb/daemonize.py +++ b/bitbake/lib/bb/daemonize.py @@ -178,8 +178,8 @@ def createDaemon(function, logfile): # os.dup2(0, 2) # standard error (2) - si = file('/dev/null', 'r') - so = file(logfile, 'w') + si = open('/dev/null', 'r') + so = open(logfile, 'w') se = so diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 4ba688bfea..cba783f5ab 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -450,7 +450,7 @@ class MirrorUriTest(FetcherTest): class FetcherLocalTest(FetcherTest): def setUp(self): def touch(fn): - with file(fn, 'a'): + with open(fn, 'a'): os.utime(fn, None) super(FetcherLocalTest, self).setUp() 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): sys.stdout.flush() sys.stderr.flush() - si = file('/dev/null', 'r') - so = file(self.logfile, 'a+') + si = open('/dev/null', 'r') + so = open(self.logfile, 'a+') se = so os.dup2(si.fileno(),sys.stdin.fileno()) os.dup2(so.fileno(),sys.stdout.fileno()) @@ -263,7 +263,7 @@ class PRServer(SimpleXMLRPCServer): # write pidfile pid = str(os.getpid()) - pf = file(self.pidfile, 'w') + pf = open(self.pidfile, 'w') pf.write("%s\n" % pid) pf.close() @@ -323,7 +323,7 @@ def start_daemon(dbfile, host, port, logfile): ip = socket.gethostbyname(host) pidfile = PIDPREFIX % (ip, port) try: - pf = file(pidfile,'r') + pf = open(pidfile,'r') pid = int(pf.readline().strip()) pf.close() except IOError: @@ -350,7 +350,7 @@ def stop_daemon(host, port): ip = socket.gethostbyname(host) pidfile = PIDPREFIX % (ip, port) try: - pf = file(pidfile,'r') + pf = open(pidfile,'r') pid = int(pf.readline().strip()) pf.close() except IOError: |