Ignore:
Timestamp:
Oct 9, 2011, 10:36:13 PM (8 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Children:
1084:325018bf6786, 1085:4e88cafd4845
Message:
Use `super` instead of "classic" base class constructor call.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mock_ftplib.py

    r905 r1083  
    2525
    2626
    27 class MockFile(StringIO.StringIO):
     27class MockFile(StringIO.StringIO, object):
    2828    """
    2929    Mock class for the file objects _contained in_ `_FTPFile` objects
     
    3636        global mock_files
    3737        mock_files[path] = self
    38         StringIO.StringIO.__init__(self, content)
     38        super(MockFile, self).__init__(content)
    3939
    4040    def getvalue(self):
    4141        if not self.closed:
    42             return StringIO.StringIO.getvalue(self)
     42            return super(MockFile, self).getvalue()
    4343        else:
    4444            return self._value_after_close
     
    4646    def close(self):
    4747        if not self.closed:
    48             self._value_after_close = StringIO.StringIO.getvalue(self)
    49         StringIO.StringIO.close(self)
     48            self._value_after_close = super(MockFile, self).getvalue()
     49        super(MockFile, self).close()
    5050
    5151
Note: See TracChangeset for help on using the changeset viewer.