From c23b138ed72d794521b19ff7d8076b32b0b7bf46 Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Sun, 8 Sep 2019 22:05:57 +0200 Subject: 2to3 --- bubbob/macbinary.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'bubbob/macbinary.py') diff --git a/bubbob/macbinary.py b/bubbob/macbinary.py index 616bce0..a485290 100644 --- a/bubbob/macbinary.py +++ b/bubbob/macbinary.py @@ -43,16 +43,16 @@ class TypeList: return self.resources()[id] def keys(self): - return self.resources().keys() + return list(self.resources().keys()) def values(self): - return self.resources().values() + return list(self.resources().values()) def items(self): - return self.resources().items() + return list(self.resources().items()) def namedict(self): - return dict([(r.name, r) for r in self.resources().values() if r.name is not None]) + return dict([(r.name, r) for r in list(self.resources().values()) if r.name is not None]) class MacBinary: @@ -93,22 +93,22 @@ class MacBinary: return self.dtypes def keys(self): - return self.dtypes.keys() + return list(self.dtypes.keys()) def values(self): - return self.dtypes.values() + return list(self.dtypes.values()) def items(self): - return self.dtypes.items() + return list(self.dtypes.items()) class Subfile: def __init__(self, f, start, length): if start < 0: - raise ValueError, 'negative position' + raise ValueError('negative position') if isinstance(f, Subfile): if start + length > f.length: - raise ValueError, 'subfile out of bounds' + raise ValueError('subfile out of bounds') f, start = f.f, f.start+start self.f = f self.start = start @@ -124,7 +124,7 @@ class Subfile: return self.f.read(size) def seek(self, npos): if npos < 0: - raise ValueError, 'negative position' + raise ValueError('negative position') self.position = npos @@ -186,7 +186,7 @@ class ppatResource(Resource): f = self.subfile() pattype, patmap, patdata = struct.unpack(">Hll", f.read(10)) if pattype != 1: - raise ValueError, 'Pattern type not supported' + raise ValueError('Pattern type not supported') f.seek(patmap) (rowBytes, h, w, packType, packSize, pixelType, pixelSize, cmpCount, cmpSize, pmTable) = ( @@ -194,9 +194,9 @@ class ppatResource(Resource): isBitmap = (rowBytes & 0x8000) != 0 rowBytes &= 0x3FFF if packType != 0: - raise ValueError, 'packed image not supported' + raise ValueError('packed image not supported') if pixelType != 0 or cmpCount != 1: - raise ValueError, 'direct RGB image not supported' + raise ValueError('direct RGB image not supported') assert cmpSize == pixelSize and pixelSize in [1,2,4,8] f.seek(pmTable) colormap = loadcolormap(f) -- cgit v1.2.3