There's no need to open and exec the file, since "import" already does this implicitly. Since we always expect this file to exist, the change of error in case of failure from: FileNotFoundError: [Errno 2] No such file or directory: 'gpiod/version.py' to the following: ModuleNotFoundError: No module named 'gpiod.version' is immaterial. Phil Howard (1): bindings: python: don't use exec to get __version__ bindings/python/setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.34.1