File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -676,8 +676,6 @@ def testCompress4G(self, size):
676
676
finally :
677
677
data = None
678
678
679
- # TODO: RUSTPYTHON
680
- @unittest .expectedFailure
681
679
def testPickle (self ):
682
680
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
683
681
with self .assertRaises (TypeError ):
@@ -736,8 +734,6 @@ def testDecompress4G(self, size):
736
734
compressed = None
737
735
decompressed = None
738
736
739
- # TODO: RUSTPYTHON
740
- @unittest .expectedFailure
741
737
def testPickle (self ):
742
738
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
743
739
with self .assertRaises (TypeError ):
Original file line number Diff line number Diff line change @@ -103,6 +103,11 @@ mod _bz2 {
103
103
self . state . lock ( ) . needs_input ( )
104
104
}
105
105
106
+ #[ pymethod( name = "__reduce__" ) ]
107
+ fn reduce ( & self , vm : & VirtualMachine ) -> PyResult < ( ) > {
108
+ Err ( vm. new_type_error ( "cannot pickle '_bz2.BZ2Decompressor' object" . to_owned ( ) ) )
109
+ }
110
+
106
111
// TODO: mro()?
107
112
}
108
113
@@ -185,5 +190,10 @@ mod _bz2 {
185
190
state. flushed = true ;
186
191
Ok ( vm. ctx . new_bytes ( out. to_vec ( ) ) )
187
192
}
193
+
194
+ #[ pymethod( name = "__reduce__" ) ]
195
+ fn reduce ( & self , vm : & VirtualMachine ) -> PyResult < ( ) > {
196
+ Err ( vm. new_type_error ( "cannot pickle '_bz2.BZ2Compressor' object" . to_owned ( ) ) )
197
+ }
188
198
}
189
199
}
You can’t perform that action at this time.
0 commit comments