Commit 835dc01
BUG: Use absolute module path PyCapsule_Import
Addresses:
```
ImportError: PyCapsule_Import could not import module "_ITKCommonPython"
```
That can occur when unpickling for Dask, for example.
According to the `PyCapsule_Import` documentation, internally it calls
`PyImport_ImportModule`. According to the `PyImport_ImportModule`
documentation, this requires the absolute path -- we add the `itk.`
prefix.
In most other contexts, the `_ITKCommonPython` module is likely to
already be imported. Since `_ITKCommonPython` gets loaded via
PyImport_ImportModule, it is not registered with the ITK lazy loading
module system, so we add `from . import _ITKCommon`.1 parent 4fd5ea0 commit 835dc01
4 files changed
Lines changed: 7 additions & 2 deletions
File tree
- Wrapping
- Generators
- Python
- PyBase
- SwigInterface
- macro_files
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1489 | 1489 | | |
1490 | 1490 | | |
1491 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
1492 | 1494 | | |
| 1495 | + | |
1493 | 1496 | | |
1494 | 1497 | | |
1495 | 1498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
0 commit comments