File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,13 @@ impl PyInt {
287287 where
288288 I : PrimInt + TryFrom < & ' a BigInt > ,
289289 {
290+ // TODO: Python 3.14+: ValueError for negative int to unsigned type
291+ // See stdlib_socket.py socket.htonl(-1)
292+ //
293+ // if I::min_value() == I::zero() && self.as_bigint().sign() == Sign::Minus {
294+ // return Err(vm.new_value_error("Cannot convert negative int".to_owned()));
295+ // }
296+
290297 I :: try_from ( self . as_bigint ( ) ) . map_err ( |_| {
291298 vm. new_overflow_error ( format ! (
292299 "Python int too large to convert to Rust {}" ,
Original file line number Diff line number Diff line change 131131with assert_raises (OSError ):
132132 socket .inet_aton ("test" )
133133
134- with assert_raises (OverflowError ):
135- socket .htonl (- 1 )
134+ # TODO: RUSTPYTHON
135+ # with assert_raises(ValueError):
136+ # socket.htonl(-1)
136137
137138assert socket .htonl (0 ) == 0
138139assert socket .htonl (10 ) == 167772160
You can’t perform that action at this time.
0 commit comments