from typing import Union
import pathlib


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

    >>> assert get_gecko_version_from_path_gecko_msi_filename(pathlib.Path('wine_gecko-2.47-x86.msi')) == '2.47'
    """
    gecko_version = str(path_gecko_msi_filename).split('-')[1]
    return gecko_version