File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -369,8 +369,6 @@ def test_b16encode(self):
369369 b'0102ABCDEF' )
370370 self .check_encode_type_errors (base64 .b16encode )
371371
372- # TODO: RUSTPYTHON
373- @unittest .expectedFailure
374372 def test_b16decode (self ):
375373 eq = self .assertEqual
376374 eq (base64 .b16decode (b'0102ABCDEF' ), b'\x01 \x02 \xab \xcd \xef ' )
Original file line number Diff line number Diff line change @@ -234,8 +234,6 @@ def test_rle(self):
234234 decoded = binascii .rledecode_hqx (encoded )
235235 self .assertEqual (decoded , data )
236236
237- # TODO: RUSTPYTHON
238- @unittest .expectedFailure
239237 def test_hex (self ):
240238 # test hexlification
241239 s = b'{s\005 \000 \000 \000 worldi\002 \000 \000 \000 s\005 \000 \000 \000 helloi\001 \000 \000 \000 0'
Original file line number Diff line number Diff line change @@ -60,15 +60,18 @@ mod decl {
6060 fn unhexlify ( data : ArgAsciiBuffer , vm : & VirtualMachine ) -> PyResult < Vec < u8 > > {
6161 data. with_ref ( |hex_bytes| {
6262 if hex_bytes. len ( ) % 2 != 0 {
63- return Err ( vm . new_value_error ( "Odd-length string" . to_owned ( ) ) ) ;
63+ return Err ( new_binascii_error ( "Odd-length string" . to_owned ( ) , vm ) ) ;
6464 }
6565
6666 let mut unhex = Vec :: < u8 > :: with_capacity ( hex_bytes. len ( ) / 2 ) ;
6767 for ( n1, n2) in hex_bytes. iter ( ) . tuples ( ) {
6868 if let ( Some ( n1) , Some ( n2) ) = ( unhex_nibble ( * n1) , unhex_nibble ( * n2) ) {
6969 unhex. push ( n1 << 4 | n2) ;
7070 } else {
71- return Err ( vm. new_value_error ( "Non-hexadecimal digit found" . to_owned ( ) ) ) ;
71+ return Err ( new_binascii_error (
72+ "Non-hexadecimal digit found" . to_owned ( ) ,
73+ vm,
74+ ) ) ;
7275 }
7376 }
7477
You can’t perform that action at this time.
0 commit comments