diff options
| author | 2018-03-14 02:56:04 +0100 | |
|---|---|---|
| committer | 2018-03-14 20:23:00 -0400 | |
| commit | 23ac25c0b388b5ffebf66154b12a3950b89b977a (patch) | |
| tree | 27ae214e393e6be2efc225d02ffc93135aaa2eb5 /minidinstall/misc.py | |
| parent | 9883708468224628f9e0e577162fb5345fe20eb4 (diff) | |
Port to Python 3
Diffstat (limited to 'minidinstall/misc.py')
| -rw-r--r-- | minidinstall/misc.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 <tv@beamnet.de> +# Copyright © 2004 Thomas Viehmann <tv@beamnet.de> # 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) |
