From dadf17bd43e9b723108c61d02490022b59aecbe6 Mon Sep 17 00:00:00 2001 From: Jordan Adler Date: Thu, 25 Oct 2018 15:21:01 -0700 Subject: [PATCH] Fix py2.6 compat issues --- src/future/backports/misc.py | 4 ++-- tests/test_future/test_futurize.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/future/backports/misc.py b/src/future/backports/misc.py index e883d335..ef752078 100644 --- a/src/future/backports/misc.py +++ b/src/future/backports/misc.py @@ -817,7 +817,7 @@ def __delitem__(self, key): try: del self.maps[0][key] except KeyError: - raise KeyError('Key not found in the first mapping: {!r}'.format(key)) + raise KeyError('Key not found in the first mapping: {0!r}'.format(key)) def popitem(self): 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.' @@ -831,7 +831,7 @@ def pop(self, key, *args): try: return self.maps[0].pop(key, *args) except KeyError: - raise KeyError('Key not found in the first mapping: {!r}'.format(key)) + raise KeyError('Key not found in the first mapping: {0!r}'.format(key)) def clear(self): 'Clear maps[0], leaving maps[1:] intact.' diff --git a/tests/test_future/test_futurize.py b/tests/test_future/test_futurize.py index 9ba53ee6..5549a010 100644 --- a/tests/test_future/test_futurize.py +++ b/tests/test_future/test_futurize.py @@ -1194,7 +1194,7 @@ def total_count(self): x = 3 / 2 y = 3. / 2 - foo = range(100) + foo = list(range(100)) assert x == 1 and isinstance(x, int) assert y == 1.5 and isinstance(y, float) a = 1 + foo[len(foo) / 2]