@@ -66,18 +66,18 @@ impl ZstdCompressionWriter {
6666
6767 fn __iter__ ( slf : PyRef < Self > ) -> PyResult < ( ) > {
6868 let py = slf. py ( ) ;
69- let io = py. import_bound ( "io" ) ?;
69+ let io = py. import ( "io" ) ?;
7070 let exc = io. getattr ( "UnsupportedOperation" ) ?;
7171
72- Err ( PyErr :: from_value_bound ( exc) )
72+ Err ( PyErr :: from_value ( exc) )
7373 }
7474
7575 fn __next__ ( slf : PyRef < Self > ) -> PyResult < Option < ( ) > > {
7676 let py = slf. py ( ) ;
77- let io = py. import_bound ( "io" ) ?;
77+ let io = py. import ( "io" ) ?;
7878 let exc = io. getattr ( "UnsupportedOperation" ) ?;
7979
80- Err ( PyErr :: from_value_bound ( exc) )
80+ Err ( PyErr :: from_value ( exc) )
8181 }
8282
8383 fn __enter__ < ' p > ( mut slf : PyRefMut < ' p , Self > , _py : Python < ' p > ) -> PyResult < PyRefMut < ' p , Self > > {
@@ -158,28 +158,28 @@ impl ZstdCompressionWriter {
158158 #[ pyo3( signature = ( size=None ) ) ]
159159 #[ allow( unused_variables) ]
160160 fn readline ( & self , py : Python , size : Option < & Bound < ' _ , PyAny > > ) -> PyResult < ( ) > {
161- let io = py. import_bound ( "io" ) ?;
161+ let io = py. import ( "io" ) ?;
162162 let exc = io. getattr ( "UnsupportedOperation" ) ?;
163163
164- Err ( PyErr :: from_value_bound ( exc) )
164+ Err ( PyErr :: from_value ( exc) )
165165 }
166166
167167 #[ pyo3( signature = ( hint=None ) ) ]
168168 #[ allow( unused_variables) ]
169169 fn readlines ( & self , py : Python , hint : Option < & Bound < ' _ , PyAny > > ) -> PyResult < ( ) > {
170- let io = py. import_bound ( "io" ) ?;
170+ let io = py. import ( "io" ) ?;
171171 let exc = io. getattr ( "UnsupportedOperation" ) ?;
172172
173- Err ( PyErr :: from_value_bound ( exc) )
173+ Err ( PyErr :: from_value ( exc) )
174174 }
175175
176176 #[ pyo3( signature = ( pos, whence=None ) ) ]
177177 #[ allow( unused_variables) ]
178178 fn seek ( & self , py : Python , pos : isize , whence : Option < & Bound < ' _ , PyAny > > ) -> PyResult < ( ) > {
179- let io = py. import_bound ( "io" ) ?;
179+ let io = py. import ( "io" ) ?;
180180 let exc = io. getattr ( "UnsupportedOperation" ) ?;
181181
182- Err ( PyErr :: from_value_bound ( exc) )
182+ Err ( PyErr :: from_value ( exc) )
183183 }
184184
185185 fn seekable ( & self ) -> bool {
@@ -189,10 +189,10 @@ impl ZstdCompressionWriter {
189189 #[ pyo3( signature = ( size=None ) ) ]
190190 #[ allow( unused_variables) ]
191191 fn truncate ( & self , py : Python , size : Option < & Bound < ' _ , PyAny > > ) -> PyResult < ( ) > {
192- let io = py. import_bound ( "io" ) ?;
192+ let io = py. import ( "io" ) ?;
193193 let exc = io. getattr ( "UnsupportedOperation" ) ?;
194194
195- Err ( PyErr :: from_value_bound ( exc) )
195+ Err ( PyErr :: from_value ( exc) )
196196 }
197197
198198 fn writable ( & self ) -> bool {
@@ -207,25 +207,25 @@ impl ZstdCompressionWriter {
207207 #[ pyo3( signature = ( size=None ) ) ]
208208 #[ allow( unused_variables) ]
209209 fn read ( & self , py : Python , size : Option < & Bound < ' _ , PyAny > > ) -> PyResult < ( ) > {
210- let io = py. import_bound ( "io" ) ?;
210+ let io = py. import ( "io" ) ?;
211211 let exc = io. getattr ( "UnsupportedOperation" ) ?;
212212
213- Err ( PyErr :: from_value_bound ( exc) )
213+ Err ( PyErr :: from_value ( exc) )
214214 }
215215
216216 fn readall ( & self , py : Python ) -> PyResult < ( ) > {
217- let io = py. import_bound ( "io" ) ?;
217+ let io = py. import ( "io" ) ?;
218218 let exc = io. getattr ( "UnsupportedOperation" ) ?;
219219
220- Err ( PyErr :: from_value_bound ( exc) )
220+ Err ( PyErr :: from_value ( exc) )
221221 }
222222
223223 #[ allow( unused_variables) ]
224224 fn readinto ( & self , py : Python , b : & Bound < ' _ , PyAny > ) -> PyResult < ( ) > {
225- let io = py. import_bound ( "io" ) ?;
225+ let io = py. import ( "io" ) ?;
226226 let exc = io. getattr ( "UnsupportedOperation" ) ?;
227227
228- Err ( PyErr :: from_value_bound ( exc) )
228+ Err ( PyErr :: from_value ( exc) )
229229 }
230230
231231 fn write ( & mut self , py : Python , buffer : PyBuffer < u8 > ) -> PyResult < usize > {
@@ -252,7 +252,7 @@ impl ZstdCompressionWriter {
252252
253253 if !self . dest_buffer . is_empty ( ) {
254254 // TODO avoid buffer copy.
255- let chunk = PyBytes :: new_bound ( py, & self . dest_buffer ) ;
255+ let chunk = PyBytes :: new ( py, & self . dest_buffer ) ;
256256 self . writer . call_method1 ( py, "write" , ( chunk, ) ) ?;
257257
258258 total_write += self . dest_buffer . len ( ) ;
@@ -299,7 +299,7 @@ impl ZstdCompressionWriter {
299299
300300 if !self . dest_buffer . is_empty ( ) {
301301 // TODO avoid buffer copy.
302- let chunk = PyBytes :: new_bound ( py, & self . dest_buffer ) ;
302+ let chunk = PyBytes :: new ( py, & self . dest_buffer ) ;
303303 self . writer . call_method1 ( py, "write" , ( chunk, ) ) ?;
304304
305305 total_write += self . dest_buffer . len ( ) ;
0 commit comments