From: A Frederick Christensen Date: Wed, 13 May 2015 18:29:19 +0000 (-0400) Subject: Fix setup.py to run in python3 X-Git-Tag: 1.0.0~1^2~57^2~16^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=9aa5d3b9aafd9ed7a6e250d96b693af4aebcfa14;p=imapclient.git Fix setup.py to run in python3 --- diff --git a/setup.py b/setup.py index a610087..d14697b 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,10 @@ from setuptools.command.test import test as TestCommand # Read version info (without importing the whole imapclient package) info = {} -execfile(path.join('imapclient', 'version.py'), {}, info) +with open(path.join('imapclient', 'version.py')) as f: + code = compile(f.read(), path.join('imapclient', 'version.py'), 'exec') + exec(code, {}, info) + MAJ_MIN = sys.version_info[:2] IS_PY_26_OR_OLDER = MAJ_MIN <= (2, 6)