diff --git a/setup.py b/setup.py index bc228e473..04d239b08 100644 --- a/setup.py +++ b/setup.py @@ -75,8 +75,10 @@ def write_version_py(): def get_version(): with open(version_file, 'r') as f: - exec(compile(f.read(), version_file, 'exec')) - return locals()['__version__'] + code = compile(f.read(), version_file, 'exec') + namespace = {} + exec(code, namespace) + return namespace.get('__version__', '1.4.2') def make_cuda_ext(name, module, sources, sources_cuda=None):