From 3a6296fff210d498302ce0a2da6beed689466347 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 22 Mar 2021 20:36:08 +0100 Subject: [PATCH] - more python 3.x fixes --- TLD_Builder/bqueue.py | 2 +- TLD_Builder/install.py | 2 +- TLD_Builder/mailer.py | 2 +- TLD_Builder/notify.py | 4 ++-- TLD_Builder/pipeutil.py | 4 ++-- TLD_Builder/request_fetcher.py | 2 +- TLD_Builder/wrap.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TLD_Builder/bqueue.py b/TLD_Builder/bqueue.py index eab166d..d5b183f 100644 --- a/TLD_Builder/bqueue.py +++ b/TLD_Builder/bqueue.py @@ -128,7 +128,7 @@ class B_Queue: fcntl.flock(self.fd, fcntl.LOCK_UN) def write_signed(self, name): - sio = StringIO.StringIO() + sio = StringIO() self._write_to(sio) sio.seek(0) sio.write(gpg.sign(sio.read())) diff --git a/TLD_Builder/install.py b/TLD_Builder/install.py index 02cdfd7..d8badcc 100644 --- a/TLD_Builder/install.py +++ b/TLD_Builder/install.py @@ -79,7 +79,7 @@ def upgrade_from_batch(r, b): b.log_line("upgrade would need removal of %s" % k) return False b.log_line("upgrading packages") - logbuf = StringIO.StringIO() + logbuf = StringIO() res = chroot.run("rpm -Fvh %s" % ' '.join(b.files), user = "root", logfile = b.logfile) if res != 0: b.log_line("package upgrade failed") diff --git a/TLD_Builder/mailer.py b/TLD_Builder/mailer.py index 5ccf63a..a0e1bb5 100644 --- a/TLD_Builder/mailer.py +++ b/TLD_Builder/mailer.py @@ -21,7 +21,7 @@ def recode(s): class Message: def __init__(self): self.headers = {} - self.body = StringIO.StringIO() + self.body = StringIO() self.set_std_headers() def set_header(self, n, v): diff --git a/TLD_Builder/notify.py b/TLD_Builder/notify.py index ed5df8b..e13c052 100644 --- a/TLD_Builder/notify.py +++ b/TLD_Builder/notify.py @@ -14,12 +14,12 @@ from config import config class Notifier: def __init__(self, g): - self.xml = StringIO.StringIO() + self.xml = StringIO() self.xml.write("\n" % \ (g.id, config.builder)) def send(self, r): - sio = StringIO.StringIO() + sio = StringIO() self.xml.write("\n") self.xml.seek(0) sio.write(gpg.sign(self.xml.read())) diff --git a/TLD_Builder/pipeutil.py b/TLD_Builder/pipeutil.py index 9a3ca23..a3e78c9 100644 --- a/TLD_Builder/pipeutil.py +++ b/TLD_Builder/pipeutil.py @@ -9,9 +9,9 @@ else: from io import StringIO def rw_pipe(buf_, infd, outfd): - buf = StringIO.StringIO() + buf = StringIO() buf.write(buf_.read()) - ret = StringIO.StringIO() + ret = StringIO() pos = 0 rd_fin = 0 wr_fin = 0 diff --git a/TLD_Builder/request_fetcher.py b/TLD_Builder/request_fetcher.py index 609ec71..fc9f49d 100644 --- a/TLD_Builder/request_fetcher.py +++ b/TLD_Builder/request_fetcher.py @@ -73,7 +73,7 @@ def fetch_queue(control_url): signal.alarm(0) log.error("can't fetch %s: %s" % (control_url + "/queue.gz", e)) sys.exit(1) - sio = StringIO.StringIO() + sio = StringIO() util.sendfile(f, sio) f.close() sio.seek(0) diff --git a/TLD_Builder/wrap.py b/TLD_Builder/wrap.py index 9f62992..3d7c4a8 100644 --- a/TLD_Builder/wrap.py +++ b/TLD_Builder/wrap.py @@ -48,7 +48,7 @@ def wrap(main): exctype, value = sys.exc_info()[:2] if exctype == SystemExit: sys.exit(value) - s = StringIO.StringIO() + s = StringIO() traceback.print_exc(file = s, limit = 20) log.alert("fatal python exception") -- 2.46.0