From e9d62b2750353e3016a0b666832de11165a02e45 Mon Sep 17 00:00:00 2001 From: Vlad Emelyanov Date: Tue, 28 May 2013 15:17:08 +0400 Subject: [PATCH 1/2] fixed _pack_value_int usage (broken select) --- src/tarantool/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tarantool/schema.py b/src/tarantool/schema.py index bfe42443..a1e17f02 100644 --- a/src/tarantool/schema.py +++ b/src/tarantool/schema.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ### pylint: disable=C0301,W0105,W0401,W0614 ''' -This module provides :class:`~tarantool.schema.Schema` class. +This module provides :class:`~tarantool.schema.Schema` class. It is a Tarantool schema description. ''' @@ -245,7 +245,7 @@ def pack_value(self, value, cast_to = None): if value > 4294967295: return self._pack_value_int64(value) else: - return self.pack_value_int(value) + return self._pack_value_int(value) elif isinstance(value, long): return self._pack_value_int64(value) else: From 3e1f210c4e1777e41c606ee2a50b9cdb49828709 Mon Sep 17 00:00:00 2001 From: Vlad Emelyanov Date: Tue, 28 May 2013 15:19:32 +0400 Subject: [PATCH 2/2] fixed sys.version_info for python < 2.7 --- src/tarantool/response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tarantool/response.py b/src/tarantool/response.py index 35627f6d..ba33d35a 100644 --- a/src/tarantool/response.py +++ b/src/tarantool/response.py @@ -25,7 +25,7 @@ def __new__(cls, value): if isinstance(value, unicode): return super(field, cls).__new__(cls, value.encode("utf-8", "replace")) - if sys.version_info.major < 3 and isinstance(value, str): + if sys.version_info[0] < 3 and isinstance(value, str): return super(field, cls).__new__(cls, value) if isinstance(value, (bytearray, bytes)): @@ -57,7 +57,7 @@ def __int__(self): raise ValueError("Unable to cast field to int: length must be 4 or 8 bytes, field length is %d"%len(self)) - if sys.version_info.major > 2: + if sys.version_info[0] > 2: def __str__(self): '''\ Cast filed to str