From bd3fa3bb64a2284451b07e62398960727c1b7a3a Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Wed, 10 Aug 2016 21:39:14 +0200 Subject: [PATCH] Fix #376: Execfile does not exist in python 3 (#377) * Add execfile function since it's missing in python 3. * Remove extra space. --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index 3b114c51d..bd57d845b 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,13 @@ def requirements(): return requirements_list + +def execfile(fn): + with open(fn) as f: + code = compile(f.read(), fn, 'exec') + exec(code) + + with codecs.open('README.rst', 'r', 'utf-8') as fd: execfile(os.path.join('telegram', 'version.py'))