Skip to content

Commit

Permalink
Changed calling parent constructor to use super instead of explicitly…
Browse files Browse the repository at this point in the history
… calling the classes. Fixes mfenniak#31 for pypy compatibility.
  • Loading branch information
Jeff Hui committed Apr 29, 2012
1 parent 4abdca4 commit b3a6485
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyPdf/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def writeToStream(self, stream, encryption_key):

class NumberObject(int, PdfObject):
def __init__(self, value):
int.__init__(value)
super(NumberObject, self).__init__(value)

def writeToStream(self, stream, encryption_key):
stream.write(repr(self))
Expand Down Expand Up @@ -417,7 +417,7 @@ class NameObject(str, PdfObject):
delimiterCharacters = "(", ")", "<", ">", "[", "]", "{", "}", "/", "%"

def __init__(self, data):
str.__init__(data)
super(NameObject, self).__init__(data)

def writeToStream(self, stream, encryption_key):
stream.write(self)
Expand Down Expand Up @@ -663,7 +663,7 @@ def __init__(self, arr):
# must have four points
assert len(arr) == 4
# automatically convert arr[x] into NumberObject(arr[x]) if necessary
ArrayObject.__init__(self, [self.ensureIsNumber(x) for x in arr])
super(RectangleObject, self).__init__(self, [self.ensureIsNumber(x) for x in arr])

def ensureIsNumber(self, value):
if not isinstance(value, (NumberObject, FloatObject)):
Expand All @@ -687,7 +687,7 @@ def getUpperRight_y(self):

def getUpperLeft_x(self):
return self.getLowerLeft_x()

def getUpperLeft_y(self):
return self.getUpperRight_y()

Expand Down

0 comments on commit b3a6485

Please sign in to comment.