MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / non_windows_platform

Function non_windows_platform

web/pgadmin/tools/psql/__init__.py:259–281  ·  view source on GitHub ↗
(parent, p, fd, data, max_read_bytes, sid)

Source from the content-addressed store, hash-verified

257
258
259def non_windows_platform(parent, p, fd, data, max_read_bytes, sid):
260 while p and p.poll() is None:
261 if request.sid in app.config['sessions']:
262 # This code is added to make this unit testable.
263 if "is_test" not in data:
264 sio.sleep(0.01)
265 else:
266 data['count'] += 1
267 if data['count'] == 5:
268 break
269
270 timeout = 0
271 # module provides access to platform-specific I/O
272 # monitoring functions
273 try:
274 (data_ready, _, _) = select.select([parent, fd], [], [],
275 timeout)
276
277 read_terminal_data(parent, data_ready, max_read_bytes, sid)
278 except OSError:
279 # If the process is killed, bad file descriptor exception may
280 # occur. Handle it gracefully
281 pass
282
283
284def pty_handel_io(connection_data, data, sid):

Callers 1

pty_handel_ioFunction · 0.85

Calls 3

read_terminal_dataFunction · 0.85
selectMethod · 0.80
pollMethod · 0.45

Tested by

no test coverage detected