def _ensureOldClass(cls):
    """
    Ensure that C{cls} is an old-style class.

    @param cls: The class to check.

    @return: The class, if it is an old-style class.
    @raises: L{ValueError} if it is a new-style class.
    """
    if not type(cls) is types.ClassType:
        from twisted.python.reflect import fullyQualifiedName

        raise ValueError(
            ("twisted.python._oldstyle._oldStyle is being used to decorate a "
             "new-style class ({cls}). This should only be used to "
             "decorate old-style classes.").format(
                 cls=fullyQualifiedName(cls)))

    return cls

    Ensure that C{cls} is an old-style class.

    @param cls: The class to check.

    @return: The class, if it is an old-style class.
    @raises: L{ValueError} if it is a new-style class.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/_oldstyle.py