1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

fix compatibility search for platform names that append the version number (e.g. freebsd12)

This commit is contained in:
Kelly Brazil
2020-05-30 15:48:29 -07:00
parent 6423c9efd6
commit bf2ff3ffbb

View File

@ -56,7 +56,14 @@ def compatibility(mod_name, compatible):
no return, just prints output to STDERR
"""
if sys.platform not in compatible:
platform_found = False
for platform in compatible:
if platform.startswith(sys.platform):
platform_found = True
break
if not platform_found:
mod = mod_name.split('.')[-1]
compat_list = ', '.join(compatible)
warning_message(f'{mod} parser not compatible with your OS ({sys.platform}).\n Compatible platforms: {compat_list}')