Return the essential suffix of a filename, discarding Unix-style version numbers. For example for 'libz.so.1.2.8' returns '.so'
(filename)
| 117 | |
| 118 | |
| 119 | def get_file_suffix(filename): |
| 120 | """Return the essential suffix of a filename, discarding Unix-style version numbers. |
| 121 | |
| 122 | For example for 'libz.so.1.2.8' returns '.so' |
| 123 | """ |
| 124 | while filename: |
| 125 | filename, suffix = os.path.splitext(filename) |
| 126 | if not suffix[1:].isdigit(): |
| 127 | return suffix |
| 128 | return '' |
| 129 | |
| 130 | |
| 131 | def normalize_path(path): |
no outgoing calls
no test coverage detected