falcosecurity/kernel-crawler

Fix Python3 Support

EXONER4TED opened this issue · 0 comments

The recent Minikube update broke Python3 support.

Describe the bug

╰─❯ python3 __init__.py crawl --distro ubuntu --out_fmt driverkit
Traceback (most recent call last):
  File "/Users/lbond/Programming/github/falcosecurity/kernel-crawler/__init__.py", line 6, in <module>
    from kernel_crawler import crawl_kernels, DISTROS
  File "/Users/lbond/Programming/github/falcosecurity/kernel-crawler/kernel_crawler/__init__.py", line 1, in <module>
    from .minikube import MinikubeMirror
  File "/Users/lbond/Programming/github/falcosecurity/kernel-crawler/kernel_crawler/minikube.py", line 7, in <module>
    from types import NoneType
ImportError: cannot import name 'NoneType' from 'types' (/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/types.py)

from types import NoneType is a Python2 legacy thing - Python3 can just compare to None directly.

How to reproduce it

To reproduce - clone main, try running with python3.

Expected behaviour

It runs 😉

Screenshots

Environment

  • Falco version:
  • System info:
  • Cloud provider or hardware configuration:
  • OS:
  • Kernel:
  • Installation method:

Additional context

Is this repo intentionally Python2? Or can it be Python3? I'm not sure which it's trying to be, but I would think Python3 to be forward looking. Please let me know though 😄