Skip to content

Commit 024caef

Browse files
committed
copyman: Make sure copyman works on pre-3.3 python too
1 parent 49e8e10 commit 024caef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

postgresql/copyman.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ def update(self, view, getlen = ulong_unpack, len = len):
243243
# Emit the number of messages "consumed" this round.
244244
return nmessages
245245

246-
def __init__(self, condition = CopyData.type[0].__ne__):
246+
def __init__(self, condition = (CopyData.type[0].__ne__ if sys.version_info[:2] >= (3, 3)
247+
else CopyData.type.__ne__)):
247248
self.remaining_bytes = 0
248249
self.size_fragment = b''
249250
self.final_view = None

0 commit comments

Comments
 (0)