Refs #23919 -- Replaced super() calls for old-style classes.

This commit is contained in:
Nick Pope 2017-12-07 14:10:32 +00:00 committed by Tim Graham
parent 9d1d0e2b70
commit c68f66e014
10 changed files with 10 additions and 10 deletions

View File

@ -242,7 +242,7 @@ class GDALBand(GDALRasterBase):
class BandList(list): class BandList(list):
def __init__(self, source): def __init__(self, source):
self.source = source self.source = source
list.__init__(self) super().__init__()
def __iter__(self): def __iter__(self):
for idx in range(1, len(self) + 1): for idx in range(1, len(self) + 1):

View File

@ -31,7 +31,7 @@ class TransformPoint(list):
def __init__(self, raster, prop): def __init__(self, raster, prop):
x = raster.geotransform[self.indices[prop][0]] x = raster.geotransform[self.indices[prop][0]]
y = raster.geotransform[self.indices[prop][1]] y = raster.geotransform[self.indices[prop][1]]
list.__init__(self, [x, y]) super().__init__([x, y])
self._raster = raster self._raster = raster
self._prop = prop self._prop = prop

View File

@ -31,7 +31,7 @@ class Options:
class BaseDatabaseCache(BaseCache): class BaseDatabaseCache(BaseCache):
def __init__(self, table, params): def __init__(self, table, params):
BaseCache.__init__(self, params) super().__init__(params)
self._table = table self._table = table
class CacheEntry: class CacheEntry:

View File

@ -5,7 +5,7 @@ from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
class DummyCache(BaseCache): class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs): def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs) super().__init__(*args, **kwargs)
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
key = self.make_key(key, version=version) key = self.make_key(key, version=version)

View File

@ -21,7 +21,7 @@ def dummy():
class LocMemCache(BaseCache): class LocMemCache(BaseCache):
def __init__(self, name, params): def __init__(self, name, params):
BaseCache.__init__(self, params) super().__init__(params)
self._cache = _caches.setdefault(name, {}) self._cache = _caches.setdefault(name, {})
self._expire_info = _expire_info.setdefault(name, {}) self._expire_info = _expire_info.setdefault(name, {})
self._lock = _locks.setdefault(name, RWLock()) self._lock = _locks.setdefault(name, RWLock())

View File

@ -332,7 +332,7 @@ class Command(BaseCommand):
class SingleZipReader(zipfile.ZipFile): class SingleZipReader(zipfile.ZipFile):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
zipfile.ZipFile.__init__(self, *args, **kwargs) super().__init__(*args, **kwargs)
if len(self.namelist()) != 1: if len(self.namelist()) != 1:
raise ValueError("Zip-compressed fixtures must contain one file.") raise ValueError("Zip-compressed fixtures must contain one file.")

View File

@ -308,7 +308,7 @@ class DefusedExpatParser(_ExpatParser):
Forbid DTDs, external entity references Forbid DTDs, external entity references
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
_ExpatParser.__init__(self, *args, **kwargs) super().__init__(*args, **kwargs)
self.setFeature(handler.feature_external_ges, False) self.setFeature(handler.feature_external_ges, False)
self.setFeature(handler.feature_external_pes, False) self.setFeature(handler.feature_external_pes, False)

View File

@ -148,7 +148,7 @@ class Parser(HTMLParser):
) )
def __init__(self): def __init__(self):
HTMLParser.__init__(self, convert_charrefs=False) super().__init__(convert_charrefs=False)
self.root = RootElement() self.root = RootElement()
self.open_tags = [] self.open_tags = []
self.element_positions = {} self.element_positions = {}

View File

@ -136,7 +136,7 @@ def linebreaks(value, autoescape=False):
class MLStripper(HTMLParser): class MLStripper(HTMLParser):
def __init__(self): def __init__(self):
HTMLParser.__init__(self, convert_charrefs=False) super().__init__(convert_charrefs=False)
self.reset() self.reset()
self.fed = [] self.fed = []

View File

@ -82,7 +82,7 @@ class AdminEmailHandler(logging.Handler):
""" """
def __init__(self, include_html=False, email_backend=None): def __init__(self, include_html=False, email_backend=None):
logging.Handler.__init__(self) super().__init__()
self.include_html = include_html self.include_html = include_html
self.email_backend = email_backend self.email_backend = email_backend