diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 7b58c5ef5..7bf4e8279 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -1131,6 +1131,7 @@ class CGIHTTPServerTestCase(BaseTestCase): res = self.request('/cgi-bin/file7.py', 'POST', body, headers) self.assertEqual(res.read(), b'%d %d' % (size, size) + self.linesep) + @unittest.skipIf(sys.platform == "darwin", "TODO: RUSTPYTHON; flaky: the 1ms handler timeout also bounds reading the request line") def test_large_content_length_truncated(self): with support.swap_attr(self.request_handler, 'timeout', 0.001): for w in range(18, 65): diff --git a/crates/vm/src/object/ext.rs b/crates/vm/src/object/ext.rs index eda0d7f4b..da68c1820 100644 --- a/crates/vm/src/object/ext.rs +++ b/crates/vm/src/object/ext.rs @@ -2,10 +2,7 @@ use super::{ core::{Py, PyObject, PyObjectRef, PyRef}, payload::PyPayload, }; -use crate::common::{ - atomic::{Ordering, PyAtomic, Radium}, - lock::PyRwLockReadGuard, -}; +use crate::common::atomic::{Ordering, PyAtomic, Radium}; use crate::{ VirtualMachine, builtins::{PyBaseExceptionRef, PyStrInterned, PyType}, @@ -729,46 +726,6 @@ impl PyObject { // } // } -/// A borrow of a reference to a Python object. This avoids having clone the `PyRef`/ -/// `PyObjectRef`, which isn't that cheap as that increments the atomic reference counter. -// TODO: check if we still need this -#[allow(dead_code)] -pub struct PyLease<'a, T: PyPayload> { - inner: PyRwLockReadGuard<'a, PyRef>, -} - -impl PyLease<'_, T> { - #[inline(always)] - #[must_use] - pub fn into_owned(self) -> PyRef { - self.inner.clone() - } -} - -impl Borrow for PyLease<'_, T> { - #[inline(always)] - fn borrow(&self) -> &PyObject { - self.inner.as_ref() - } -} - -impl Deref for PyLease<'_, T> { - type Target = PyRef; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.inner - } -} - -impl fmt::Display for PyLease<'_, T> -where - T: PyPayload + fmt::Display, -{ - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&**self, f) - } -} - impl ToPyObject for PyRef { #[inline(always)] fn to_pyobject(self, _vm: &VirtualMachine) -> PyObjectRef {