sagemath / cysignals

cysignals: interrupt and signal handling for Cython
GNU Lesser General Public License v3.0
44 stars 23 forks source link

Use importlib.resources to find cysignals-CSI-helper.py #200

Open orlitzky opened 4 months ago

orlitzky commented 4 months ago

Currently cysignals-CSI-helper.py is installed https://github.com/sagemath/cysignals/blob/main/setup.py#L219. The script that makes use of it, cysignals-CSI, later tries to guess the install location based on sys.argv[0]: https://github.com/sagemath/cysignals/blob/main/src/scripts/cysignals-CSI#L68

This can fail if sys.argv[0] isn't something simple like /usr/bin/python, e.g. https://bugs.gentoo.org/927767

By using importlib.resources.files we could avoid guessing at all.