Commit 32d4d37
committed
import_od: Accept os.PathLike with robust suffix handling.
Utilize the standard library's os.path.splitext() function to find the
file name suffix (case-insensitive).
Fix a [union-attr] static type check error using an empty string as
fallback for the file name on file-like objects. The annotated TextIO
type does provide it, but mypy cannot infer that connection between
with the "read" method being available. Failing with the ValueError
in case the attribute is missing is still better than letting out an
AttributeError.1 parent 950edc0 commit 32d4d37
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | | - | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
0 commit comments