summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2010-04-05 16:52:25 +0200
committerFederico Di Gregorio <fog@initd.org>2010-04-05 16:52:25 +0200
commitc1a24f4ca279f8057f9f7a3fe06e9c8a5b1dc818 (patch)
tree013197ad587c453eb5cf1dbf519e1958f099e9c6 /examples
parente15bc9da05721a22e986feb0363da8c5e4eb2641 (diff)
downloadpsycopg2-c1a24f4ca279f8057f9f7a3fe06e9c8a5b1dc818.tar.gz
NOTIFYs fix and poll status changes
POLL_OK has been changed from 3 to 0 to let the user specify a short loop just as "if not curs.poll()" instead of having to check for write and read separately. For an example of this, see examples/notify.py.
Diffstat (limited to 'examples')
-rw-r--r--examples/notify.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/notify.py b/examples/notify.py
index b5a613d..c88098a 100644
--- a/examples/notify.py
+++ b/examples/notify.py
@@ -39,5 +39,5 @@ while 1:
if select.select([curs],[],[],5)==([],[],[]):
print "Timeout"
else:
- if curs.isready():
+ if not curs.poll():
print "Got NOTIFY: %s" % str(curs.connection.notifies.pop())