From 3ab5319a73d8e7c17ddb35db6295237570fc5e41 Mon Sep 17 00:00:00 2001 From: Toby Dacre Date: Mon, 29 Jan 2018 17:56:37 +0100 Subject: [PATCH 1/2] Improve python3 support In python 3 long and int types have been unified and it is no longer legal to use the L postfix to declare a long. As this postfix is used in snakebite it fails under python 3. This commit improves python 3 support for some use cases. It is not intended to make snakebite fully python 3 compatible in any way but just to remove a common issue. This changes allows limited functionality under python 3 which is enough for many usecases. --- snakebite/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snakebite/client.py b/snakebite/client.py index 572b5f3..12e9b74 100644 --- a/snakebite/client.py +++ b/snakebite/client.py @@ -1470,7 +1470,7 @@ def _switch_namenode(self, namenodes): def __calculate_exponential_time(self, time, retries, cap): # Same calculation as the original Hadoop client but converted to seconds - baseTime = min(time * (1L << retries), cap); + baseTime = min(time * (long(1) << retries), cap); return (baseTime * (random.random() + 0.5)) / 1000; def __do_retry_sleep(self, retries): From 2551991d6f6bc7eb92f40f38c535a6efffdb25ae Mon Sep 17 00:00:00 2001 From: Toby Dacre Date: Mon, 29 Jan 2018 18:25:11 +0100 Subject: [PATCH 2/2] remove travis-ci python 2.6 as no longer available --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec33da3..1c85151 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,7 @@ branches: except: - gh-pages env: - - TOX_ENV=py26-cdh - TOX_ENV=py27-cdh - - TOX_ENV=py26-hdp - TOX_ENV=py27-hdp install: - pip install tox