Commit bdb17ae
authored
FIX: guard second usage of PyWeakref_GetObject (#934)
* FIX: guard second usage of PyWeakref_GetObject
This function was deprecated in 3.13 and will be removed in 3.15. There
are two usages in pycurl, one in easy.c was already correctly guarded, the
other in share.c was not.
* MNT: Handle NULL / dead case in 3.13+ code path correctly
* MNT: further simplify handling the both old and new code paths
obj is only `None` in the <3.13 code path if the weakref is dead. Handle and
return early to simplify later code.
* MNT: let weakref errors propogate up and out1 parent 8c0a5a8 commit bdb17ae
1 file changed
Lines changed: 38 additions & 11 deletions
File tree
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
267 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
268 | 285 | | |
269 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
270 | 296 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
275 | 301 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | 302 | | |
| 303 | + | |
| 304 | + | |
282 | 305 | | |
283 | 306 | | |
284 | 307 | | |
285 | 308 | | |
286 | 309 | | |
287 | 310 | | |
| 311 | + | |
288 | 312 | | |
289 | 313 | | |
290 | 314 | | |
| |||
329 | 353 | | |
330 | 354 | | |
331 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
332 | 359 | | |
333 | 360 | | |
334 | 361 | | |
| |||
0 commit comments