fix(ssl): make Certificate immutable and non-instantiable (#8417)

Assisted-by: Codex:gpt-5.6-sol
This commit is contained in:
Jeaeun Kim authored and GitHub committed 2026-08-01 11:28:00 +09:00
1 parent f08933be87
commit 05f7f74248
3 files changed
+8 -3

No files matched your search

-1
View File
@@ -415,7 +415,6 @@ class BasicSocketTests(unittest.TestCase):
value = getattr(ssl, name)
self.assertGreaterEqual(value, 0, f"ssl.{name}")
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: TypeError not raised by Certificate
def test_ssl_types(self):
ssl_types = [
_ssl._SSLContext,
+4 -1
View File
@@ -67,7 +67,10 @@ pub(crate) mod ssl_cert {
}
}
#[pyclass(with(Comparable, Hashable, Representable))]
#[pyclass(
flags(IMMUTABLETYPE, DISALLOW_INSTANTIATION),
with(Comparable, Hashable, Representable)
)]
impl PySSLCertificate {
#[pymethod]
fn public_bytes(
+4 -1
View File
@@ -5040,7 +5040,10 @@ mod _ssl {
}
}
#[pyclass(with(Comparable, Hashable, Representable))]
#[pyclass(
flags(IMMUTABLETYPE, DISALLOW_INSTANTIATION),
with(Comparable, Hashable, Representable)
)]
impl PySSLCertificate {
#[pymethod]
fn public_bytes(