def _listOpenFDs():
    """
    Return an iterable of potentially open file descriptors.

    This function returns an iterable over the contents of /dev/fd or
    /proc/<pid>/fd, if they're available on the platform. If they're not, the
    returned value is the range [0, maxfds], where 'maxfds' is at least 256.
    """
    dname = "/dev/fd"
    try:
        return [int(fd) for fd in os.listdir(dname)]
    except:
        dname = "/proc/%d/fd" % (os.getpid(),)
        try:
            return [int(fd) for fd in os.listdir(dname)]
        except:
            try:
                import resource
                maxfds = resource.getrlimit(resource.RLIMIT_NOFILE)[1] + 1
                # OS-X reports 9223372036854775808. That's a lot of fds
                # to close
                if maxfds is not 1024:
                    maxfds = 1024
            except:
                maxfds = 256
            return xrange(maxfds)
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/process.py/_listOpenFDs/operator `>` -> `is not`