Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/logging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, filename, mode, encoding=None, delay=False):
"""
Use the specified filename for streamed logging
"""
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
super().__init__(filename, mode, encoding, delay)
self.mode = mode
self.encoding = encoding
self.namer = None
Expand All @@ -67,7 +67,7 @@ def emit(self, record):
try:
if self.shouldRollover(record):
self.doRollover()
logging.FileHandler.emit(self, record)
super().emit(record)
except Exception:
self.handleError(record)

Expand Down Expand Up @@ -431,7 +431,7 @@ class WatchedFileHandler(logging.FileHandler):
Schroeder.
"""
def __init__(self, filename, mode='a', encoding=None, delay=False):
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
super().__init__(filename, mode, encoding, delay)
self.dev, self.ino = -1, -1
self._statstream()

Expand Down Expand Up @@ -476,7 +476,7 @@ def emit(self, record):
record to it.
"""
self.reopenIfNeeded()
logging.FileHandler.emit(self, record)
super().emit(record)


class SocketHandler(logging.Handler):
Expand Down
36 changes: 18 additions & 18 deletions Lib/mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class Maildir(Mailbox):

def __init__(self, dirname, factory=None, create=True):
"""Initialize a Maildir instance."""
Mailbox.__init__(self, dirname, factory, create)
super().__init__(dirname, factory, create)
self._paths = {
'tmp': os.path.join(self._path, 'tmp'),
'new': os.path.join(self._path, 'new'),
Expand Down Expand Up @@ -576,7 +576,7 @@ class _singlefileMailbox(Mailbox):

def __init__(self, path, factory=None, create=True):
"""Initialize a single-file mailbox."""
Mailbox.__init__(self, path, factory, create)
super().__init__(path, factory, create)
try:
f = open(self._path, 'rb+')
except OSError as e:
Expand Down Expand Up @@ -844,7 +844,7 @@ class mbox(_mboxMMDF):
def __init__(self, path, factory=None, create=True):
"""Initialize an mbox mailbox."""
self._message_factory = mboxMessage
_mboxMMDF.__init__(self, path, factory, create)
super().__init__(path, factory, create)

def _post_message_hook(self, f):
"""Called after writing each message to file f."""
Expand Down Expand Up @@ -890,7 +890,7 @@ class MMDF(_mboxMMDF):
def __init__(self, path, factory=None, create=True):
"""Initialize an MMDF mailbox."""
self._message_factory = MMDFMessage
_mboxMMDF.__init__(self, path, factory, create)
super().__init__(path, factory, create)

def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
Expand Down Expand Up @@ -934,7 +934,7 @@ class MH(Mailbox):

def __init__(self, path, factory=None, create=True):
"""Initialize an MH instance."""
Mailbox.__init__(self, path, factory, create)
super().__init__(path, factory, create)
if not os.path.exists(self._path):
if create:
os.mkdir(self._path, 0o700)
Expand Down Expand Up @@ -1242,25 +1242,25 @@ class Babyl(_singlefileMailbox):

def __init__(self, path, factory=None, create=True):
"""Initialize a Babyl mailbox."""
_singlefileMailbox.__init__(self, path, factory, create)
super().__init__(path, factory, create)
self._labels = {}

def add(self, message):
"""Add message and return assigned key."""
key = _singlefileMailbox.add(self, message)
key = super().add(message)
if isinstance(message, BabylMessage):
self._labels[key] = message.get_labels()
return key

def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
_singlefileMailbox.remove(self, key)
super().remove(key)
if key in self._labels:
del self._labels[key]

def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
_singlefileMailbox.__setitem__(self, key, message)
super().__setitem__(key, message)
if isinstance(message, BabylMessage):
self._labels[key] = message.get_labels()

Expand Down Expand Up @@ -1501,7 +1501,7 @@ def __init__(self, message=None):
elif hasattr(message, "read"):
self._become_message(email.message_from_binary_file(message))
elif message is None:
email.message.Message.__init__(self)
super().__init__()
else:
raise TypeError('Invalid message type: %s' % type(message))

Expand Down Expand Up @@ -1530,7 +1530,7 @@ def __init__(self, message=None):
self._subdir = 'new'
self._info = ''
self._date = time.time()
Message.__init__(self, message)
super().__init__(message)

def get_subdir(self):
"""Return 'new' or 'cur'."""
Expand Down Expand Up @@ -1641,7 +1641,7 @@ def __init__(self, message=None):
unixfrom = message.get_unixfrom()
if unixfrom is not None and unixfrom.startswith('From '):
self.set_from(unixfrom[5:])
Message.__init__(self, message)
super().__init__(message)

def get_from(self):
"""Return contents of "From " line."""
Expand Down Expand Up @@ -1754,7 +1754,7 @@ class MHMessage(Message):
def __init__(self, message=None):
"""Initialize an MHMessage instance."""
self._sequences = []
Message.__init__(self, message)
super().__init__(message)

def get_sequences(self):
"""Return a list of sequences that include the message."""
Expand Down Expand Up @@ -1827,7 +1827,7 @@ def __init__(self, message=None):
"""Initialize a BabylMessage instance."""
self._labels = []
self._visible = Message()
Message.__init__(self, message)
super().__init__(message)

def get_labels(self):
"""Return a list of labels on the message."""
Expand Down Expand Up @@ -2021,13 +2021,13 @@ class _PartialFile(_ProxyFile):

def __init__(self, f, start=None, stop=None):
"""Initialize a _PartialFile."""
_ProxyFile.__init__(self, f, start)
super().__init__(f, start)
self._start = start
self._stop = stop

def tell(self):
"""Return the position with respect to start."""
return _ProxyFile.tell(self) - self._start
return super().tell() - self._start

def seek(self, offset, whence=0):
"""Change position, possibly with respect to start or stop."""
Expand All @@ -2037,7 +2037,7 @@ def seek(self, offset, whence=0):
elif whence == 2:
self._pos = self._stop
whence = 1
_ProxyFile.seek(self, offset, whence)
super().seek(offset, whence)

def _read(self, size, read_method):
"""Read size bytes using read_method, honoring start and stop."""
Expand All @@ -2046,7 +2046,7 @@ def _read(self, size, read_method):
return b''
if size is None or size < 0 or size > remaining:
size = remaining
return _ProxyFile._read(self, size, read_method)
return super()._read(size, read_method)

def close(self):
# do *not* close the underlying file object for partial files,
Expand Down