From d79c438d5dbb79284cdcfe5977dc7eefa0e97e2c Mon Sep 17 00:00:00 2001 From: behackett Date: Thu, 9 Aug 2012 16:17:54 -0700 Subject: [PATCH] Work around OSX 10.8 Python 2.5 bug PYTHON-389 See PYTHON-389 for more details. --- bson/timestamp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bson/timestamp.py b/bson/timestamp.py index 7895c708b..185b7c177 100644 --- a/bson/timestamp.py +++ b/bson/timestamp.py @@ -20,6 +20,7 @@ import datetime from bson.tz_util import utc +UPPERBOUND = 4294967296 class Timestamp(object): """MongoDB internal timestamps used in the opLog. @@ -54,9 +55,9 @@ class Timestamp(object): raise TypeError("time must be an instance of int") if not isinstance(inc, (int, long)): raise TypeError("inc must be an instance of int") - if not 0 <= time < 2 ** 32: + if not 0 <= time < UPPERBOUND: raise ValueError("time must be contained in [0, 2**32)") - if not 0 <= inc < 2 ** 32: + if not 0 <= inc < UPPERBOUND: raise ValueError("inc must be contained in [0, 2**32)") self.__time = time