MCPcopy Create free account
hub / github.com/celery/celery / _open_fds

Function _open_fds

celery/platforms.py:335–347  ·  view source on GitHub ↗

List the descriptors open in this process, or :const:`None`. :const:`None` means this platform has no directory listing them, and the caller has to scan a numeric range instead.

()

Source from the content-addressed store, hash-verified

333
334
335def _open_fds():
336 """List the descriptors open in this process, or :const:`None`.
337
338 :const:`None` means this platform has no directory listing them, and the
339 caller has to scan a numeric range instead.
340 """
341 if SYSTEM in {'DragonFly', 'FreeBSD'} and not _dev_fd_is_fdescfs():
342 return None
343 try:
344 names = os.listdir(_FD_DIR)
345 except OSError:
346 return None
347 return sorted(int(name) for name in names if name.isdigit())
348
349
350def close_open_fds(keep=None):

Callers 2

fd_by_pathFunction · 0.85
close_open_fdsFunction · 0.85

Calls 1

_dev_fd_is_fdescfsFunction · 0.85

Tested by

no test coverage detected