diff --git a/setup.py b/setup.py index b3bf0cee..2b86be3c 100644 --- a/setup.py +++ b/setup.py @@ -25,8 +25,12 @@ class RequiredDependencyException(Exception): def get_version(): """Returns version of the project.""" version_file = "pillow_heif/_version.py" - exec(compile(Path(version_file).read_text(encoding="utf-8"), version_file, "exec")) # pylint: disable=exec-used - return locals()["__version__"] + result = {} + exec( # pylint: disable=exec-used + compile(Path(version_file).read_text(encoding="utf-8"), version_file, "exec"), + result, + ) + return result["__version__"] def _cmd_exists(cmd: str) -> bool: