mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
fix(ssl): make Certificate immutable and non-instantiable (#8417)
Assisted-by: Codex:gpt-5.6-sol
This commit is contained in:
1 parent
f08933be87
commit
05f7f74248
3 files changed
+8
-3
No files matched your search
Vendored
-1
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user