From 0c3c629bdf3b9ae5555f7f47de0372683aaafa7f Mon Sep 17 00:00:00 2001 From: Philippe Makowski Date: Wed, 10 Oct 2012 14:09:54 +0000 Subject: [PATCH] fix PYFB-22 --- fdb/fbcore.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fdb/fbcore.py b/fdb/fbcore.py index 365f28a..9bf7e80 100644 --- a/fdb/fbcore.py +++ b/fdb/fbcore.py @@ -391,13 +391,13 @@ def inc_pointer(pointer): def bytes_to_bint(b): # Read as big endian len_b = len(b) if len_b == 1: - fmt = 'b' + fmt = 'B' elif len_b == 2: - fmt = '>h' + fmt = '>H' elif len_b == 4: - fmt = '>l' + fmt = '>L' elif len_b == 8: - fmt = '>q' + fmt = '>Q' else: raise InternalError return struct.unpack(fmt, b)[0] @@ -405,39 +405,39 @@ def bytes_to_bint(b): # Read as big endian def bytes_to_int(b): # Read as little endian. len_b = len(b) if len_b == 1: - fmt = 'b' + fmt = 'B' elif len_b == 2: - fmt = '