quarkslab / python-binexport

Python interface for Binexport, the Bindiff export format
Apache License 2.0
14 stars 2 forks source link

Do not work with Python 3.9 #15

Open ebrocas opened 11 months ago

ebrocas commented 11 months ago

Hello,

I've tried to run python-binexport (through the command line tool) with a Python 3.9 installation and it does not work.

$ binexporter
Traceback (most recent call last):
  File "/usr/local/bin/binexporter", line 5, in <module>
    from binexport.__main__ import main
  File "/usr/local/lib/python3.9/site-packages/binexport/__init__.py", line 1, in <module>
    from .program import ProgramBinExport
  File "/usr/local/lib/python3.9/site-packages/binexport/program.py", line 9, in <module>
    from binexport.function import FunctionBinExport
  File "/usr/local/lib/python3.9/site-packages/binexport/function.py", line 7, in <module>
    from binexport.utils import get_basic_block_addr
  File "/usr/local/lib/python3.9/site-packages/binexport/utils.py", line 2, in <module>
    from binexport.types import Addr
  File "/usr/local/lib/python3.9/site-packages/binexport/types.py", line 3, in <module>
    from typing import TypeAlias
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/local/lib/python3.9/typing.py)

Looking at the documentation of the typing module, TypeAlias was introduced with Python 3.10 (https://docs.python.org/3.10/library/typing.html#typing.TypeAlias).

I suppose that either you could find a workaround or either you should just modify the pyproject.toml to announce that you do not support Python 3.9 and only above versions.

Thanks in advance !

patacca commented 10 months ago

Even though python 3.9 will reach EOL at the end of 2025 I would still prefer keeping the usage of TypeAlias as it's better for type checkers such as mypy. IMHO we can update the requirement to python >= 3.10. What do you think about this @RobinDavid ?