From 550afa9c0e64e3598b3993fb0bcea314056bf1fe Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Sat, 21 Nov 2015 12:18:30 +0800 Subject: [PATCH] msgpackutils: drop Python 2.6 support We doesn't support python 2.6 now, this commit removes Python 2.6 related code in module msgpackutls. Change-Id: Id148239ee6c1ad461188fa38b06ca0d7913d7454 --- oslo_serialization/msgpackutils.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/oslo_serialization/msgpackutils.py b/oslo_serialization/msgpackutils.py index b73fd1a..1797088 100644 --- a/oslo_serialization/msgpackutils.py +++ b/oslo_serialization/msgpackutils.py @@ -31,7 +31,6 @@ This module provides a few things: import datetime import functools import itertools -import sys import uuid import msgpack @@ -42,13 +41,6 @@ import six.moves.xmlrpc_client as xmlrpclib netaddr = importutils.try_import("netaddr") -# NOTE(harlowja): itertools.count only started to take a step value -# in python 2.7+ so we can't use it in 2.6... -if sys.version_info[0:2] == (2, 6): - _PY26 = True -else: - _PY26 = False - # Expose these so that users don't have to import msgpack to gain these. PackException = msgpack.PackException @@ -187,13 +179,7 @@ class CountHandler(object): def deserialize(data): value = msgpack.unpackb(data) start, step = value - if not _PY26: - return itertools.count(start, step) - else: - if step != 1: - raise ValueError("Python 2.6.x does not support steps" - " that are not equal to one") - return itertools.count(start) + return itertools.count(start, step) if netaddr is not None: