From 5a6b11b8c3d26a64f16caf545ba9f6d4df7e6578 Mon Sep 17 00:00:00 2001 From: Menno Smits Date: Fri, 23 Jan 2015 22:23:33 +1300 Subject: [PATCH] simplify reading of version module --- setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 176dd60..a610087 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,8 @@ # Released subject to the New BSD License # Please see http://en.wikipedia.org/wiki/BSD_licenses -from os.path import join +import sys +from os import path # bootstrap setuptools if necessary from ez_setup import use_setuptools @@ -13,11 +14,9 @@ use_setuptools() from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand -import sys -# read meta-data from release.py +# Read version info (without importing the whole imapclient package) info = {} -metamod = join('imapclient', 'version.py') -exec(compile(open(metamod).read(), metamod, 'exec'), {}, info) +execfile(path.join('imapclient', 'version.py'), {}, info) MAJ_MIN = sys.version_info[:2] IS_PY_26_OR_OLDER = MAJ_MIN <= (2, 6) -- 2.43.0