Skip to content

Commit d14fb69

Browse files
committed
Remove Python 2 compat super calls
1 parent 86111da commit d14fb69

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

geoip2/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class HTTPError(GeoIP2Error):
3838
def __init__(
3939
self, message: str, http_status: Optional[int] = None, uri: Optional[str] = None
4040
) -> None:
41-
super(HTTPError, self).__init__(message)
41+
super().__init__(message)
4242
self.http_status = http_status
4343
self.uri = uri
4444

geoip2/models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class City(Country):
186186
def __init__(
187187
self, raw_response: Dict[str, Any], locales: Optional[List[str]] = None
188188
) -> None:
189-
super(City, self).__init__(raw_response, locales)
189+
super().__init__(raw_response, locales)
190190
self.city = geoip2.records.City(locales, **raw_response.get("city", {}))
191191
self.location = geoip2.records.Location(**raw_response.get("location", {}))
192192
self.postal = geoip2.records.Postal(**raw_response.get("postal", {}))
@@ -426,7 +426,7 @@ class AnonymousIP(SimpleModel):
426426
is_tor_exit_node: bool
427427

428428
def __init__(self, raw: Dict[str, bool]) -> None:
429-
super(AnonymousIP, self).__init__(raw) # type: ignore
429+
super().__init__(raw) # type: ignore
430430
self.is_anonymous = raw.get("is_anonymous", False)
431431
self.is_anonymous_vpn = raw.get("is_anonymous_vpn", False)
432432
self.is_hosting_provider = raw.get("is_hosting_provider", False)
@@ -472,7 +472,7 @@ class ASN(SimpleModel):
472472

473473
# pylint:disable=too-many-arguments
474474
def __init__(self, raw: Dict[str, Union[str, int]]) -> None:
475-
super(ASN, self).__init__(raw)
475+
super().__init__(raw)
476476
self.autonomous_system_number = cast(
477477
Optional[int], raw.get("autonomous_system_number")
478478
)
@@ -517,7 +517,7 @@ class ConnectionType(SimpleModel):
517517
connection_type: Optional[str]
518518

519519
def __init__(self, raw: Dict[str, Union[str, int]]) -> None:
520-
super(ConnectionType, self).__init__(raw)
520+
super().__init__(raw)
521521
self.connection_type = cast(Optional[str], raw.get("connection_type"))
522522

523523

@@ -551,7 +551,7 @@ class Domain(SimpleModel):
551551
domain: Optional[str]
552552

553553
def __init__(self, raw: Dict[str, Union[str, int]]) -> None:
554-
super(Domain, self).__init__(raw)
554+
super().__init__(raw)
555555
self.domain = cast(Optional[str], raw.get("domain"))
556556

557557

@@ -605,6 +605,6 @@ class ISP(ASN):
605605

606606
# pylint:disable=too-many-arguments
607607
def __init__(self, raw: Dict[str, Union[str, int]]) -> None:
608-
super(ISP, self).__init__(raw)
608+
super().__init__(raw)
609609
self.isp = cast(Optional[str], raw.get("isp"))
610610
self.organization = cast(Optional[str], raw.get("organization"))

geoip2/records.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(
105105
) -> None:
106106
self.confidence = confidence
107107
self.geoname_id = geoname_id
108-
super(City, self).__init__(locales, names)
108+
super().__init__(locales, names)
109109

110110

111111
class Continent(PlaceRecord):
@@ -159,7 +159,7 @@ def __init__(
159159
) -> None:
160160
self.code = code
161161
self.geoname_id = geoname_id
162-
super(Continent, self).__init__(locales, names)
162+
super().__init__(locales, names)
163163

164164

165165
class Country(PlaceRecord):
@@ -233,7 +233,7 @@ def __init__(
233233
self.geoname_id = geoname_id
234234
self.is_in_european_union = is_in_european_union
235235
self.iso_code = iso_code
236-
super(Country, self).__init__(locales, names)
236+
super().__init__(locales, names)
237237

238238

239239
class RepresentedCountry(Country):
@@ -313,7 +313,7 @@ def __init__(
313313
**_
314314
) -> None:
315315
self.type = type
316-
super(RepresentedCountry, self).__init__(
316+
super().__init__(
317317
locales, confidence, geoname_id, is_in_european_union, iso_code, names
318318
)
319319

@@ -535,7 +535,7 @@ def __init__(
535535
self.confidence = confidence
536536
self.geoname_id = geoname_id
537537
self.iso_code = iso_code
538-
super(Subdivision, self).__init__(locales, names)
538+
super().__init__(locales, names)
539539

540540

541541
class Subdivisions(tuple):
@@ -554,14 +554,14 @@ def __new__(
554554
cls: Type["Subdivisions"], locales: Optional[List[str]], *subdivisions
555555
) -> "Subdivisions":
556556
subobjs = tuple(Subdivision(locales, **x) for x in subdivisions)
557-
obj = super(cls, Subdivisions).__new__(cls, subobjs) # type: ignore
557+
obj = super().__new__(cls, subobjs) # type: ignore
558558
return obj
559559

560560
def __init__(
561561
self, locales: Optional[List[str]], *subdivisions # pylint:disable=W0613
562562
) -> None:
563563
self._locales = locales
564-
super(Subdivisions, self).__init__()
564+
super().__init__()
565565

566566
@property
567567
def most_specific(self) -> Subdivision:

0 commit comments

Comments
 (0)