def del_windows_env_var(key):
    """Delete an env var.

    Raises:
        WindowsError
    """

    if not isinstance(key, text_type):
        raise TypeError("%r not of type %r" % (key, text_type))

    status = winapi.SetEnvironmentVariableW(key, None)
    if status == 0:
        raise ctypes.WinError()
Delete an env var.

    Raises:
        WindowsError