File "/Volumes/nexB/repos/scancode.io/lib/python3.10/site-packages/typecode/contenttype.py", line 32, in <module>
from typecode import magic2
File "/Volumes/nexB/repos/scancode.io/lib/python3.10/site-packages/typecode/magic2.py", line 378, in <module>
libmagic = load_lib()
File "/Volumes/nexB/repos/scancode.io/lib/python3.10/site-packages/typecode/magic2.py", line 174, in load_lib
failover_lib = load_lib_failover()
File "/Volumes/nexB/repos/scancode.io/lib/python3.10/site-packages/typecode/magic2.py", line 137, in load_lib_failover
platform = 'linux' if sys.platform.startswith('linux') else sys.platform
NameError: name 'sys' is not defined
https://github.com/nexB/typecode/blob/main/src/typecode/magic2.py#L136
Simply move the sys import @ https://github.com/nexB/typecode/blob/main/src/typecode/magic2.py#L55 outside the trace condition.