From 74f55a283a9f62ef505cebac2ccda9177ee3ef81 Mon Sep 17 00:00:00 2001 From: Bernie Hackett Date: Wed, 20 Aug 2014 11:30:12 -0700 Subject: [PATCH] PYTHON-346 - Eliminate _get_int unsigned option This cleans up a few pylint complaints and provides a small perf improvement. --- bson/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bson/__init__.py b/bson/__init__.py index c375d7d57..f8f870130 100644 --- a/bson/__init__.py +++ b/bson/__init__.py @@ -91,10 +91,9 @@ BSONMIN = b"\xFF" # Min key BSONMAX = b"\x7F" # Max key -def _get_int(data, position, dummy, unsigned=False): - format = unsigned and "I" or "i" +def _get_int(data, position, dummy): try: - value = struct.unpack("<%s" % format, data[position:position + 4])[0] + value = struct.unpack("