aboutsummaryrefslogtreecommitdiffstats
path: root/minidinstall/ChangeFile.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-03-14 02:56:04 +0100
committerLibravatarKrytarik Raido <krytarik@tuxgarage.com>2018-03-14 20:23:00 -0400
commit23ac25c0b388b5ffebf66154b12a3950b89b977a (patch)
tree27ae214e393e6be2efc225d02ffc93135aaa2eb5 /minidinstall/ChangeFile.py
parent9883708468224628f9e0e577162fb5345fe20eb4 (diff)
Port to Python 3
Diffstat (limited to 'minidinstall/ChangeFile.py')
-rw-r--r--minidinstall/ChangeFile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/minidinstall/ChangeFile.py b/minidinstall/ChangeFile.py
index 702069e..3b0cf48 100644
--- a/minidinstall/ChangeFile.py
+++ b/minidinstall/ChangeFile.py
@@ -19,7 +19,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os, re, sys, string, stat
-import threading, Queue
+import threading, queue
import logging
from minidinstall import DpkgControl, SignedFile
from minidinstall import misc
@@ -28,7 +28,7 @@ class ChangeFileException(Exception):
def __init__(self, value):
self._value = value
def __str__(self):
- return `self._value`
+ return repr(self._value)
class ChangeFile(DpkgControl.DpkgParagraph):
md5_re = r'^(?P<md5>[0-9a-f]{32})[ \t]+(?P<size>\d+)[ \t]+(?P<section>[-/a-zA-Z0-9]+)[ \t]+(?P<priority>[-a-zA-Z0-9]+)[ \t]+(?P<file>[0-9a-zA-Z][-+:.,=~0-9a-zA-Z_]+)$'
@@ -84,7 +84,7 @@ class ChangeFile(DpkgControl.DpkgParagraph):
def verify(self, sourcedir):
""" verify size and hash values from changes file """
checksum = self._get_checksum_from_changes()
- for hash in checksum.keys():
+ for hash in list(checksum.keys()):
for (hashsum, size, filename) in checksum[hash]:
self._verify_file_integrity(os.path.join(sourcedir, filename), int(size), hash, hashsum)
@@ -97,7 +97,7 @@ class ChangeFile(DpkgControl.DpkgParagraph):
if not stat.S_ISREG(statbuf[stat.ST_MODE]):
raise ChangeFileException("%s is not a regular file" % (filename,))
size = statbuf[stat.ST_SIZE]
- except OSError, e:
+ except OSError as e:
raise ChangeFileException("Can't stat %s: %s" % (filename,e.strerror))
if size != expected_size:
raise ChangeFileException("File size for %s does not match that specified in .dsc" % (filename,))