From 9aa5d3b9aafd9ed7a6e250d96b693af4aebcfa14 Mon Sep 17 00:00:00 2001 From: A Frederick Christensen Date: Wed, 13 May 2015 14:29:19 -0400 Subject: [PATCH] Fix setup.py to run in python3 --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.43.0