From 8475c322afc42f8dc3fa72d721838c9c2a2f9f27 Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Wed, 10 Aug 2016 20:59:11 +0200 Subject: [PATCH 1/3] Add execfile function since it's missing in python 3. --- setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3b114c51d..261f02d78 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')) @@ -47,4 +54,4 @@ with codecs.open('README.rst', 'r', 'utf-8') as fd: 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', - ],) + ], ) From c252042ddf87c8eda8fac2d544c1998ce5899f69 Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Wed, 10 Aug 2016 21:00:01 +0200 Subject: [PATCH 2/3] Remove extra space. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 261f02d78..bd57d845b 100644 --- a/setup.py +++ b/setup.py @@ -54,4 +54,4 @@ with codecs.open('README.rst', 'r', 'utf-8') as fd: 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', - ], ) + ],) From b736e1e855808d1b3f0050cba76450db3f68d332 Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Thu, 11 Aug 2016 13:08:28 +0200 Subject: [PATCH 3/3] Move the exec out of function, since that's a whole other scope... --- setup.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index bd57d845b..39a19f992 100644 --- a/setup.py +++ b/setup.py @@ -17,14 +17,11 @@ 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')) + fn = os.path.join('telegram', 'version.py') + with open(fn) as fh: + code = compile(fh.read(), fn, 'exec') + exec(code) setup(name='python-telegram-bot', version=__version__,