Skip to content

Commit 4ac218f

Browse files
committed
Add weakproxy bytes
1 parent 27884e2 commit 4ac218f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/test/test_weakref.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,6 @@ def test_basic_proxy(self):
258258
self.assertEqual(L3[:5], p3[:5])
259259
self.assertEqual(L3[2:5], p3[2:5])
260260

261-
# TODO: RUSTPYTHON
262-
@unittest.expectedFailure
263261
def test_proxy_unicode(self):
264262
# See bug 5037
265263
class C(object):

vm/src/builtins/weakproxy.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ impl PyWeakProxy {
7878
self.try_upgrade(vm)?.is_true(vm)
7979
}
8080

81+
#[pymethod(magic)]
82+
fn bytes(&self, vm: &VirtualMachine) -> PyResult {
83+
self.try_upgrade(vm)?.bytes(vm)
84+
}
85+
8186
fn contains(&self, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult<bool> {
8287
let obj = self.try_upgrade(vm)?;
8388
PySequence::contains(&obj, &needle, vm)

0 commit comments

Comments
 (0)