@@ -680,11 +680,11 @@ def command(self, dbname, spec, slave_ok=False,
680
680
if self .op_msg_enabled :
681
681
self ._raise_if_not_writable (unacknowledged )
682
682
try :
683
- return command (self , dbname , spec , slave_ok ,
684
- self .is_mongos , read_preference , codec_options ,
685
- session , client , check , allowable_errors ,
686
- self .address , check_keys , listeners ,
687
- self .max_bson_size , read_concern ,
683
+ return command (self , self . max_wire_version , dbname , spec ,
684
+ slave_ok , self .is_mongos , read_preference ,
685
+ codec_options , session , client , check ,
686
+ allowable_errors , self .address , check_keys ,
687
+ listeners , self .max_bson_size , read_concern ,
688
688
parse_write_concern_error = parse_write_concern_error ,
689
689
collation = collation ,
690
690
compression_ctx = self .compression_context ,
@@ -751,7 +751,8 @@ def legacy_write(self, request_id, msg, max_doc_size, with_last_error):
751
751
self .send_message (msg , max_doc_size )
752
752
if with_last_error :
753
753
reply = self .receive_message (request_id )
754
- return helpers ._check_gle_response (reply .command_response ())
754
+ return helpers ._check_gle_response (reply .command_response (),
755
+ self .max_wire_version )
755
756
756
757
def write_command (self , request_id , msg ):
757
758
"""Send "insert" etc. command, returning response as a dict.
@@ -767,7 +768,7 @@ def write_command(self, request_id, msg):
767
768
result = reply .command_response ()
768
769
769
770
# Raises NotMasterError or OperationFailure.
770
- helpers ._check_command_response (result )
771
+ helpers ._check_command_response (result , self . max_wire_version )
771
772
return result
772
773
773
774
def check_auth (self , all_credentials ):
0 commit comments