def _fileobj_lookup(self, fileobj):
try:<EOL><INDENT>return _fileobj_to_fd(fileobj)<EOL><DEDENT>except ValueError:<EOL><INDENT>for key in self._fd_to_key.values():<EOL><INDENT>if key.fileobj is fileobj:<EOL><INDENT>return key.fd<EOL><DEDENT><DEDENT>raise<EOL><DEDENT>
Return a file descriptor from a file object.

        This wraps _fileobj_to_fd() to do an exhaustive search in case
        the object is invalid but we still have it in our map.  This
        is used by unregister() so we can unregister an object that
        was previously registered even if it is closed.  It is also
        used by _SelectorMapping.