Commit f7b03f6
authored
ctypes: don't fail to load when embedded as a "frozen" package (pearu#187)
* ctypes: don't fail to load when embedded as a "frozen" package
When the module is embedded in a executable (aka "frozen"), the __file__
path is virtual, and might not actually exists on the computer.
This path is used at init to look for the DLL, by changing the current
working directory to the containing folder. As it doesn't exist, it
fails, and libtiff_ctypes cannot be imported.
Instead of completely failing, now handle such case, and just don't use
that folder as an extra location to look for the DLL.
* lsm: drop useless "global" usage
As noted by the latest flake8:
F824 `global tiff_module_dict` is unused: name is never assigned in scope
As the tiff_module_dict variable is only read, there is no need to use
a "global".1 parent e4e8a58 commit f7b03f6
2 files changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
0 commit comments