@@ -226,14 +226,15 @@ def negotiate_ssl(self) -> (bool, None):
226226 # probably not postgresql.
227227 return None
228228
229- def read_into (self ):
229+ def read_into (self , Complete = xact . Complete ):
230230 """
231231 read data from the wire and write it into the message buffer.
232232 """
233233 BUFFER_HAS_MSG = self .message_buffer .has_message
234234 BUFFER_WRITE_MSG = self .message_buffer .write
235235 RECV_DATA = self .socket .recv
236236 RECV_BYTES = self .recvsize
237+ XACT = self .xact
237238 while not BUFFER_HAS_MSG ():
238239 if self .read_data is not None :
239240 BUFFER_WRITE_MSG (self .read_data )
@@ -247,10 +248,10 @@ def read_into(self):
247248 msg = self .socket_factory .fatal_exception_message (e )
248249 if msg is not None :
249250 self .socket .close ()
250- self . xact . state = xact . Complete
251- self . xact .fatal = True
252- self . xact .exception = e
253- self . xact .error_message = element .ClientError ((
251+ XACT . state = Complete
252+ XACT .fatal = True
253+ XACT .exception = e
254+ XACT .error_message = element .ClientError ((
254255 (b'S' , 'FATAL' ),
255256 (b'C' , '08006' ),
256257 (b'M' , msg ),
@@ -265,9 +266,9 @@ def read_into(self):
265266 # nothing read from a blocking socket? it's over.
266267 if self .read_data == b'' :
267268 self .socket .close ()
268- self . xact . state = xact . Complete
269- self . xact .fatal = True
270- self . xact .error_message = eof_error
269+ XACT . state = Complete
270+ XACT .fatal = True
271+ XACT .error_message = eof_error
271272 return False
272273
273274 # Got data. Put it in the buffer and clear read_data.
0 commit comments