File tree 3 files changed +5
-6
lines changed
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):
369
369
b'0102ABCDEF' )
370
370
self .check_encode_type_errors (base64 .b16encode )
371
371
372
- # TODO: RUSTPYTHON
373
- @unittest .expectedFailure
374
372
def test_b16decode (self ):
375
373
eq = self .assertEqual
376
374
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):
234
234
decoded = binascii .rledecode_hqx (encoded )
235
235
self .assertEqual (decoded , data )
236
236
237
- # TODO: RUSTPYTHON
238
- @unittest .expectedFailure
239
237
def test_hex (self ):
240
238
# test hexlification
241
239
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 {
60
60
fn unhexlify ( data : ArgAsciiBuffer , vm : & VirtualMachine ) -> PyResult < Vec < u8 > > {
61
61
data. with_ref ( |hex_bytes| {
62
62
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 ) ) ;
64
64
}
65
65
66
66
let mut unhex = Vec :: < u8 > :: with_capacity ( hex_bytes. len ( ) / 2 ) ;
67
67
for ( n1, n2) in hex_bytes. iter ( ) . tuples ( ) {
68
68
if let ( Some ( n1) , Some ( n2) ) = ( unhex_nibble ( * n1) , unhex_nibble ( * n2) ) {
69
69
unhex. push ( n1 << 4 | n2) ;
70
70
} 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
+ ) ) ;
72
75
}
73
76
}
74
77
You can’t perform that action at this time.
0 commit comments