Commit 20fe0fb
committed
Handle modules with __file__ property being None
It's been discovered that some modules have the `__file__` property
being set as `None`. An example of a such module is `backports`.
Providing `None` to `os.path.abspath()` causes an exception:
`TypeError: expected str, bytes or os.PathLike object, not NoneType`
Related to #9461 parent d26ded2 commit 20fe0fb
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| |||
0 commit comments