def _fallbackFDImplementation(self):
        try:
            import resource
        except ImportError:
            maxfds = 1024
        else:
            # OS-X reports 9223372036854775808. That's a lot of fds to close.
            # OS-X should get the /dev/fd implementation instead, so mostly
            # this check probably isn't necessary.
            maxfds = min(1024, resource.getrlimit(resource.RLIMIT_NOFILE)[1])
        return range(maxfds)
Fallback implementation where either the resource module can inform us
dataset/ETHPy150Open twisted/twisted/twisted/internet/process.py/_FDDetector._fallbackFDImplementation