From 068488c546612ee0198cecf1a4a46e2667551bcf Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 20 Nov 2021 14:41:42 +0100 Subject: [PATCH] Fix sdists created by newer setuptools versions. This caused the PyPI package to be broken since I upgraded my computer from Debian bullseye --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f33959358..ee6606876 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,12 @@ try: time.strptime(time.asctime(time.gmtime(date)))[:3]) except: if os.path.isfile(VERSION_FILE): - from src.version import version + sys.path.insert(0, '') # Missing when installing from an sdist created + # by recent setuptools versions?! + try: + from src.version import version + finally: + sys.path.pop(0) else: version = 'installed on ' + time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime()) try: