Skip to content

Commit c1e1e03

Browse files
committed
Use Python 3 style super()
1 parent cc58342 commit c1e1e03

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

minfraud/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class HTTPError(MinFraudError):
4444
def __init__(
4545
self, message: str, http_status: Optional[int] = None, uri: Optional[str] = None
4646
) -> None:
47-
super(HTTPError, self).__init__(message)
47+
super().__init__(message)
4848
self.http_status = http_status
4949
self.uri = uri
5050

minfraud/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class GeoIP2Location(geoip2.records.Location):
8585

8686
def __init__(self, *args, **kwargs) -> None:
8787
self.local_time = kwargs.get("local_time", None)
88-
super(GeoIP2Location, self).__init__(*args, **kwargs)
88+
super().__init__(*args, **kwargs)
8989

9090

9191
class GeoIP2Country(geoip2.records.Country):
@@ -113,7 +113,7 @@ class GeoIP2Country(geoip2.records.Country):
113113

114114
def __init__(self, *args, **kwargs) -> None:
115115
self.is_high_risk = kwargs.get("is_high_risk", False)
116-
super(GeoIP2Country, self).__init__(*args, **kwargs)
116+
super().__init__(*args, **kwargs)
117117

118118

119119
class IPAddress(geoip2.models.Insights):
@@ -196,7 +196,7 @@ def __init__(self, ip_address: Dict[str, Any]) -> None:
196196
locales = ip_address.get("_locales")
197197
if "_locales" in ip_address:
198198
del ip_address["_locales"]
199-
super(IPAddress, self).__init__(ip_address, locales=locales)
199+
super().__init__(ip_address, locales=locales)
200200
self.country = GeoIP2Country(locales, **ip_address.get("country", {}))
201201
self.location = GeoIP2Location(**ip_address.get("location", {}))
202202
self.risk = ip_address.get("risk", None)
@@ -207,7 +207,7 @@ def __init__(self, ip_address: Dict[str, Any]) -> None:
207207
def __setattr__(self, name: str, value: Any) -> None:
208208
if hasattr(self, "_finalized") and self._finalized:
209209
raise AttributeError("can't set attribute")
210-
super(IPAddress, self).__setattr__(name, value)
210+
super().__setattr__(name, value)
211211

212212

213213
@_inflate_to_namedtuple

0 commit comments

Comments
 (0)