Commit 833f59f
gh-76595: Use PyObject_GetOptionalAttrString() in PyCapsule_Import()
Only AttributeError is silenced before falling back to importing a submodule; other errors from the attribute lookup are now propagated.
As a side effect, a failed import now propagates ModuleNotFoundError instead of replacing it with the generic AttributeError.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 121bcec commit 833f59f
1 file changed
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
250 | 255 | | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | 260 | | |
262 | 261 | | |
263 | 262 | | |
| |||
272 | 271 | | |
273 | 272 | | |
274 | 273 | | |
275 | | - | |
| 274 | + | |
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
| |||
0 commit comments