Skip to content

Commit 14e41aa

Browse files
author
James William Pye
committed
current_step needs to be zero when starting a new command.
1 parent a19931b commit 14e41aa

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

postgresql/protocol/client3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,20 +481,25 @@ def standard_put(self, messages):
481481
if self.commands[offset] is element.SynchronizeMessage:
482482
break
483483
else:
484+
##
485+
# It's done.
484486
self.state = Complete
485487
return count
488+
##
486489
# Not quite done, the state(Ready) message still
487490
# needs to be received.
488491
cmd = self.commands[offset]
489492
paths = self.hook[cmd.type]
493+
# On a new command, setup the new step.
494+
current_step = 0
490495
continue
491496
elif x[0] in self.asynchook:
492497
asyncs.append(self.asynchook[x[0]](x[1]))
493498
else:
494499
##
495500
# Procotol violation
496501
err = pg_exc.ProtocolError(
497-
"expected message of types %r, "\
502+
"expected message of types %r, " \
498503
"but received %r instead" % (
499504
tuple(paths[current_step].keys()), x[0]
500505
),

postgresql/test/testall.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from postgresql.test.test_iri import *
1010
from postgresql.test.test_protocol import *
11+
from postgresql.test.test_exceptions import *
1112

1213
if __name__ == '__main__':
1314
from types import ModuleType

0 commit comments

Comments
 (0)