Skip to content

Commit 529b916

Browse files
author
James William Pye
committed
Remove __context__ methods.
These are no longer used by Python.
1 parent f820cd5 commit 529b916

2 files changed

Lines changed: 0 additions & 22 deletions

File tree

postgresql/api.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,6 @@ def __enter__(self):
704704
Run the `start` method and return self.
705705
"""
706706

707-
def __context__(self):
708-
'Return self.'
709-
return self
710-
711707
@abstractmethod
712708
def __exit__(self, typ, obj, tb):
713709
"""
@@ -1198,12 +1194,6 @@ def __exit__(self, typ, obj, tb):
11981194
`True` when `None`.
11991195
"""
12001196

1201-
@abstractmethod
1202-
def __context__(self):
1203-
"""
1204-
Returns the connection object, self.
1205-
"""
1206-
12071197
class Driver(Element):
12081198
"""
12091199
The `Driver` element provides the `Connector` and other information
@@ -1372,9 +1362,6 @@ def __enter__(self):
13721362
readied.
13731363
"""
13741364

1375-
def __context__(self):
1376-
return self
1377-
13781365
@abstractmethod
13791366
def __exit__(self, exc, val, tb):
13801367
"""

postgresql/driver/pq3.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,9 +1807,6 @@ def __init__(self, database, settings_to_set):
18071807
self.database = database
18081808
self.settings_to_set = settings_to_set
18091809

1810-
def __context__(self):
1811-
return self
1812-
18131810
def __enter__(self):
18141811
if hasattr(self, 'stored_settings'):
18151812
raise RuntimeError("cannot re-use setting CMs")
@@ -1989,9 +1986,6 @@ def __init__(self, database, isolation = None, mode = None, gid = None):
19891986
self.state = 'initialized'
19901987
self.type = None
19911988

1992-
def __context__(self):
1993-
return self
1994-
19951989
def __enter__(self):
19961990
self.start()
19971991
return self
@@ -2251,9 +2245,6 @@ def __repr__(self):
22512245
self.closed and 'closed' or '%s' %(self.pq.state,)
22522246
)
22532247

2254-
def __context__(self):
2255-
return self
2256-
22572248
def __exit__(self, type, value, tb):
22582249
# Don't bother closing unless it's a normal exception.
22592250
if type is None or issubclass(type, Exception):

0 commit comments

Comments
 (0)