@@ -118,7 +118,7 @@ async def add_listener(self, channel, callback):
118118 **channel**: name of the channel the notification was sent to;
119119 **payload**: the payload.
120120 """
121- self .__check_open ()
121+ self ._check_open ()
122122 if channel not in self ._listeners :
123123 await self .fetch ('LISTEN {}' .format (channel ))
124124 self ._listeners [channel ] = set ()
@@ -182,7 +182,7 @@ def transaction(self, *, isolation='read_committed', readonly=False,
182182 .. _`PostgreSQL documentation`: https://www.postgresql.org/docs/\
183183 current/static/sql-set-transaction.html
184184 """
185- self .__check_open ()
185+ self ._check_open ()
186186 return transaction .Transaction (self , isolation , readonly , deferrable )
187187
188188 async def execute (self , query : str , * args , timeout : float = None ) -> str :
@@ -213,7 +213,7 @@ async def execute(self, query: str, *args, timeout: float=None) -> str:
213213 .. versionchanged:: 0.5.4
214214 Made it possible to pass query arguments.
215215 """
216- self .__check_open ()
216+ self ._check_open ()
217217
218218 if not args :
219219 return await self ._protocol .query (query , timeout )
@@ -244,7 +244,7 @@ async def executemany(self, command: str, args,
244244
245245 .. versionadded:: 0.7.0
246246 """
247- self .__check_open ()
247+ self ._check_open ()
248248
249249 if 'timeout' in kw :
250250 timeout = kw .pop ('timeout' )
@@ -317,7 +317,7 @@ def cursor(self, query, *args, prefetch=None, timeout=None):
317317
318318 :return: A :class:`~cursor.CursorFactory` object.
319319 """
320- self .__check_open ()
320+ self ._check_open ()
321321 return cursor .CursorFactory (self , query , None , args ,
322322 prefetch , timeout )
323323
@@ -329,7 +329,7 @@ async def prepare(self, query, *, timeout=None):
329329
330330 :return: A :class:`~prepared_stmt.PreparedStatement` instance.
331331 """
332- self .__check_open ()
332+ self ._check_open ()
333333 stmt = await self ._get_statement (query , timeout , named = True )
334334 return prepared_stmt .PreparedStatement (self , query , stmt )
335335
@@ -342,7 +342,7 @@ async def fetch(self, query, *args, timeout=None) -> list:
342342
343343 :return list: A list of :class:`Record` instances.
344344 """
345- self .__check_open ()
345+ self ._check_open ()
346346 return await self ._execute (query , args , 0 , timeout )
347347
348348 async def fetchval (self , query , * args , column = 0 , timeout = None ):
@@ -359,7 +359,7 @@ async def fetchval(self, query, *args, column=0, timeout=None):
359359
360360 :return: The value of the specified column of the first record.
361361 """
362- self .__check_open ()
362+ self ._check_open ()
363363 data = await self ._execute (query , args , 1 , timeout )
364364 if not data :
365365 return None
@@ -374,7 +374,7 @@ async def fetchrow(self, query, *args, timeout=None):
374374
375375 :return: The first row as a :class:`Record` instance.
376376 """
377- self .__check_open ()
377+ self ._check_open ()
378378 data = await self ._execute (query , args , 1 , timeout )
379379 if not data :
380380 return None
@@ -395,7 +395,7 @@ async def set_type_codec(self, typename, *,
395395 data. If ``False`` (the default), the data is
396396 expected to be encoded/decoded in text.
397397 """
398- self .__check_open ()
398+ self ._check_open ()
399399
400400 if self ._type_by_name_stmt is None :
401401 self ._type_by_name_stmt = await self .prepare (
@@ -425,7 +425,7 @@ async def set_builtin_type_codec(self, typename, *,
425425 (defaults to 'public')
426426 :param codec_name: The name of the builtin codec.
427427 """
428- self .__check_open ()
428+ self ._check_open ()
429429
430430 if self ._type_by_name_stmt is None :
431431 self ._type_by_name_stmt = await self .prepare (
@@ -470,13 +470,13 @@ def terminate(self):
470470 self ._protocol .abort ()
471471
472472 async def reset (self ):
473- self .__check_open ()
473+ self ._check_open ()
474474 self ._listeners .clear ()
475475 reset_query = self ._get_reset_query ()
476476 if reset_query :
477477 await self .execute (reset_query )
478478
479- def __check_open (self ):
479+ def _check_open (self ):
480480 if self .is_closed ():
481481 raise exceptions .InterfaceError ('connection is closed' )
482482
0 commit comments