o 6a@s<dZddlZddlZddlZdgZddZGdddZdS)z,Provide class for testing in French locale NCommaDecimalPointLocalec Cstjdkr dg}ngd}ttj}d}z5|D]}z ttj||}Wntjy0YqwWtjtj|d||fSWtjtj|d||fStjtj|dw)a:See if platform has a decimal point as comma locale. Find a locale that uses a comma instead of a period as the decimal point. Returns ------- old_locale: str Locale when the function was called. new_locale: {str, None) First French locale found, None if none found. win32FRENCH)fr_FRz fr_FR.UTF-8fi_FIz fi_FI.UTF-8Nlocale)sysplatformr getlocale LC_NUMERIC setlocaleError)locales old_locale new_localelocr;/usr/lib/python3/dist-packages/numpy/core/tests/_locales.pyfind_comma_decimal_point_locale s*  rc@s:eZdZdZe\ZZddZddZddZ dd Z d S) raSets LC_NUMERIC to a locale with comma as decimal point. Classes derived from this class have setup and teardown methods that run tests with locale.LC_NUMERIC set to a locale where commas (',') are used as the decimal point instead of periods ('.'). On exit the locale is restored to the initial locale. It also serves as context manager with the same effect. If no such locale is available, the test is skipped. .. versionadded:: 1.15.0 cC*|jdur tdtjtj|jddSNzNo French locale availabler tst_localepytestskiprr r selfrrrsetup<  zCommaDecimalPointLocale.setupcCtjtj|jddSNrrr r cur_localerrrrteardownAz CommaDecimalPointLocale.teardowncCrrrrrrr __enter__Drz!CommaDecimalPointLocale.__enter__cCr r!r")rtypevalue tracebackrrr__exit__Ir%z CommaDecimalPointLocale.__exit__N) __name__ __module__ __qualname____doc__rr#rrr$r&r*rrrrr.s  )r.r rr__ALL__rrrrrrs"