Fix for python 3.9
This fixes the runtime failures in https://lhcb-nightlies.web.cern.ch/nightly/lhcb-run2-patches-dev4/743/, which uses Python 3.9. The fix is compatible also for Python 3.8
Edited by Marco Cattaneo
GitLab service scheduled maintenance on Friday, March 21st 2025 as of 08h00 Geneva time for an estimated period of 1 hour. Further information under OTG0154918.
This fixes the runtime failures in https://lhcb-nightlies.web.cern.ch/nightly/lhcb-run2-patches-dev4/743/, which uses Python 3.9. The fix is compatible also for Python 3.8