diff options
Diffstat (limited to 'Modules/_localemodule.c')
-rw-r--r-- | Modules/_localemodule.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index fa6ab8f..aabc3ac 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -133,6 +133,14 @@ PyLocale_setlocale(PyObject* self, PyObject* args) if (!PyArg_ParseTuple(args, "i|z:setlocale", &category, &locale)) return NULL; +#if defined(MS_WINDOWS) + if (category < LC_MIN || category > LC_MAX) + { + PyErr_SetString(Error, "invalid locale category"); + return NULL; + } +#endif + if (locale) { /* set locale */ result = setlocale(category, locale); |