From 23ac25c0b388b5ffebf66154b12a3950b89b977a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Wed, 14 Mar 2018 02:56:04 +0100 Subject: Port to Python 3 --- minidinstall/misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'minidinstall/misc.py') diff --git a/minidinstall/misc.py b/minidinstall/misc.py index 94fe291..372c450 100644 --- a/minidinstall/misc.py +++ b/minidinstall/misc.py @@ -2,7 +2,7 @@ # misc tools for mini-dinstall -# Copyright © 2004 Thomas Viehmann +# Copyright © 2004 Thomas Viehmann # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ def dup2(fd,fd2): try: os.dup2(fd,fd2) success = 1 - except OSError, e: + except OSError as e: if (e.errno != errno.EBUSY) or (tries >= 3): raise # wait 0-2 seconds befor next try @@ -55,7 +55,7 @@ def get_file_sum(self, type, filename): elif type == 'sha256': sum = hashlib.sha256() self._logger.debug("Generate %s (python-internal) for %s" % (type, filename)) - f = open(filename) + f = open(filename,'rb') buf = f.read(8192) while buf != '': sum.update(buf) -- cgit v1.2.3