from typing import Union
import pathlib


def get_gecko_arch_from_path_gecko_msi_filename(path_gecko_msi_filename: Union[str, pathlib.Path]) -> str:
    """
    wine_gecko-2.47-x86.msi --> x86
    wine_gecko-2.47-x86_64.msi --> x86_64

    >>> assert get_gecko_arch_from_path_gecko_msi_filename(pathlib.Path('wine_gecko-2.47-x86.msi')) == 'x86'
    >>> assert get_gecko_arch_from_path_gecko_msi_filename(pathlib.Path('wine_gecko-2.47-x86_64.msi')) == 'x86_64'
    """
    gecko_arch = str(path_gecko_msi_filename).split('-')[2]
    gecko_arch = gecko_arch.split('.')[0]
    return gecko_arch