Skip to content

Commit 8ad41ed

Browse files
author
James William Pye
committed
Add fileno to connections if the underlying socket has the attribute.
1 parent 94b8850 commit 8ad41ed

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

postgresql/driver/pq3.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,8 @@ def connect(self):
19941994
# The startup/negotiation xact completed.
19951995
if pq.xact is None:
19961996
self.pq = pq
1997+
if hasattr(self.pq.socket, 'fileno'):
1998+
self.fileno = self.pq.socket.fileno
19971999
self.security = 'ssl' if didssl is True else None
19982000
showoption_type = element.ShowOption.type
19992001
for x in neg.asyncs:
@@ -2070,6 +2072,7 @@ def connect(self):
20702072
pass
20712073
elif scstr.lower() not in ('on','true','yes'):
20722074
self.settings['standard_conforming_strings'] = 'on'
2075+
20732076
super().connect()
20742077

20752078
def _pq_push(self, xact, controller = None):

0 commit comments

Comments
 (0)