Skip to content

Commit b5b1847

Browse files
committed
*: Modernize calls to super()
1 parent 7e2eca5 commit b5b1847

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/mbedtls/exceptions.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TLSError(Exception):
1616
"""Exception raise by Mbed TLS."""
1717

1818
def __init__(self, err=None, msg=""):
19-
super(TLSError, self).__init__()
19+
super().__init__()
2020
if err is not None:
2121
assert err >= 0
2222
self.err = err

src/mbedtls/tls.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ cdef class ClientContext(_BaseContext):
13551355
def __init__(self, _BaseConfiguration configuration not None):
13561356
_tls.mbedtls_ssl_conf_endpoint(
13571357
&configuration._ctx, _tls.MBEDTLS_SSL_IS_CLIENT)
1358-
super(ClientContext, self).__init__(configuration)
1358+
super().__init__(configuration)
13591359

13601360
def wrap_socket(self, socket, server_hostname):
13611361
"""Wrap an existing Python socket object ``socket`` and return a
@@ -1404,7 +1404,7 @@ cdef class ServerContext(_BaseContext):
14041404
def __init__(self, _BaseConfiguration configuration not None):
14051405
_tls.mbedtls_ssl_conf_endpoint(
14061406
&configuration._ctx, _tls.MBEDTLS_SSL_IS_SERVER)
1407-
super(ServerContext, self).__init__(configuration)
1407+
super().__init__(configuration)
14081408

14091409
def wrap_socket(self, socket):
14101410
"""Wrap an existing Python socket object ``socket``."""

src/mbedtls/x509.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ class BasicConstraints(
122122
"""The basic constraints for the certificate."""
123123

124124
def __new__(cls, ca=False, max_path_length=0):
125-
return super(BasicConstraints, cls).__new__(cls, ca, max_path_length)
125+
return super().__new__(cls, ca, max_path_length)
126126

127127

128128
cdef class CRT(Certificate):
129129
"""X.509 certificate."""
130130

131131
def __init__(self, const unsigned char[:] buffer):
132-
super(CRT, self).__init__()
132+
super().__init__()
133133
self._next = None
134134
if buffer is None or buffer.size == 0:
135135
return
@@ -479,7 +479,7 @@ cdef class _CRTWriter:
479479
def __init__(self, not_before, not_after, issuer, issuer_key,
480480
subject, subject_key, serial_number, digestmod,
481481
basic_constraints=BasicConstraints()):
482-
super(_CRTWriter, self).__init__()
482+
super().__init__()
483483
self.set_validity(not_before, not_after)
484484
self.set_issuer(issuer)
485485
self.set_issuer_key(issuer_key)
@@ -646,7 +646,7 @@ cdef class CSR(Certificate):
646646
"""X.509 certificate signing request parser."""
647647

648648
def __init__(self, const unsigned char[:] buffer):
649-
super(CSR, self).__init__()
649+
super().__init__()
650650
if buffer is None or buffer.size == 0:
651651
return
652652
_exc.check_error(x509.mbedtls_x509_csr_parse(
@@ -781,7 +781,7 @@ cdef class _CSRWriter:
781781
782782
"""
783783
def __init__(self, subject_key, subject, digestmod):
784-
super(_CSRWriter, self).__init__()
784+
super().__init__()
785785
self.set_subject_key(subject_key)
786786
self.set_subject(subject)
787787
self.set_digestmod(digestmod)
@@ -867,7 +867,7 @@ cdef class CRL(Certificate):
867867
"""X.509 revocation list."""
868868

869869
def __init__(self, const unsigned char[:] buffer):
870-
super(CRL, self).__init__()
870+
super().__init__()
871871
self._next = None
872872
if buffer is None or buffer.size == 0:
873873
return

0 commit comments

Comments
 (0)