Skip to content

Commit d79c438

Browse files
committed
Work around OSX 10.8 Python 2.5 bug PYTHON-389
See PYTHON-389 for more details.
1 parent 036a3b1 commit d79c438

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bson/timestamp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from bson.tz_util import utc
2222

23+
UPPERBOUND = 4294967296
2324

2425
class Timestamp(object):
2526
"""MongoDB internal timestamps used in the opLog.
@@ -54,9 +55,9 @@ def __init__(self, time, inc):
5455
raise TypeError("time must be an instance of int")
5556
if not isinstance(inc, (int, long)):
5657
raise TypeError("inc must be an instance of int")
57-
if not 0 <= time < 2 ** 32:
58+
if not 0 <= time < UPPERBOUND:
5859
raise ValueError("time must be contained in [0, 2**32)")
59-
if not 0 <= inc < 2 ** 32:
60+
if not 0 <= inc < UPPERBOUND:
6061
raise ValueError("inc must be contained in [0, 2**32)")
6162

6263
self.__time = time

0 commit comments

Comments
 (0)