Line 0
Link Here
|
|
|
1 |
Platform check fails as sys.platform returns 'freebsd' plus |
2 |
the release version e.g., 'freebsd12' and so forth where the string |
3 |
'freebsd' is only listed as compatible. |
4 |
|
5 |
--- jc/utils.py.orig 2020-05-23 14:53:34 UTC |
6 |
+++ jc/utils.py |
7 |
@@ -1,8 +1,8 @@ |
8 |
"""jc - JSON CLI output utility utils""" |
9 |
import textwrap |
10 |
import sys |
11 |
+import re |
12 |
|
13 |
- |
14 |
def warning_message(message): |
15 |
""" |
16 |
Prints a warning message for non-fatal issues |
17 |
@@ -56,7 +56,8 @@ def compatibility(mod_name, compatible): |
18 |
|
19 |
no return, just prints output to STDERR |
20 |
""" |
21 |
- if sys.platform not in compatible: |
22 |
+ platform = re.sub(r'\d+', '', sys.platform) |
23 |
+ if platform not in compatible: |
24 |
mod = mod_name.split('.')[-1] |
25 |
compat_list = ', '.join(compatible) |
26 |
warning_message(f'{mod} parser not compatible with your OS ({sys.platform}).\n Compatible platforms: {compat_list}') |