build: improve pyjson5 module import

Trying to build on Gentoo Linux is failing with the following :
> Traceback (most recent call last):
>   File "[...]/TR1X/tools/generate_init", line 7, in <module>
>     import pyjson5
> ModuleNotFoundError: No module named 'pyjson5'

On Gentoo, pyjson5 module is installed as json5.

Signed-off-by: Fabrice Delliaux <netbox253@gmail.com>
This commit is contained in:
Fabrice Delliaux 2023-11-25 14:01:34 +01:00 committed by Marcin Kurczewski
parent e353b50be8
commit 420143d76e
No known key found for this signature in database
GPG key ID: CC65E6FD28CAE42A

View file

@ -4,7 +4,10 @@ import io
import json
from pathlib import Path
import pyjson5
try:
import pyjson5
except ImportError:
import json5 as pyjson5
REPO_DIR = Path(__file__).parent.parent
BIN_DIR = REPO_DIR / "bin"