Commit 2fa9b2b1 authored by Jim Fulton's avatar Jim Fulton

Adjusted to account for apparent asynchrony between the time and

datetime modules. :(
parent 0372b655
...@@ -38,12 +38,11 @@ We'll begin our example with a fairly standard set up. We ...@@ -38,12 +38,11 @@ We'll begin our example with a fairly standard set up. We
We wait for some time to pass, record he time, and then make some other changes. We wait for some time to pass, record he time, and then make some other changes.
>>> import time >>> import time
>>> t = time.time() >>> time.sleep(.01)
>>> while time.time() <= t:
... time.sleep(.001)
>>> import datetime >>> import datetime
>>> now = datetime.datetime.utcnow() >>> now = datetime.datetime.utcnow()
>>> time.sleep(.01)
>>> root = conn.root() >>> root = conn.root()
>>> root['second'] = persistent.mapping.PersistentMapping() >>> root['second'] = persistent.mapping.PersistentMapping()
...@@ -258,7 +257,8 @@ test. ...@@ -258,7 +257,8 @@ test.
Note that if you try to open an historical connection to a time in the future, Note that if you try to open an historical connection to a time in the future,
you will get an error. you will get an error.
>>> historical_conn = db.open(at=datetime.datetime.utcnow()) >>> historical_conn = db.open(
... at=datetime.datetime.utcnow()+datetime.timedelta(1))
Traceback (most recent call last): Traceback (most recent call last):
... ...
ValueError: cannot open an historical connection in the future. ValueError: cannot open an historical connection in the future.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment