summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_datetimemodule.c2
-rw-r--r--Modules/_localemodule.c3
-rw-r--r--Modules/getpath.c4
-rw-r--r--Modules/readline.c4
-rw-r--r--Modules/timemodule.c11
5 files changed, 12 insertions, 12 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 6241967..e68c7c0 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -696,7 +696,7 @@ static int parse_isoformat_date(const char *dtstr,
if (NULL == p) {
return -1;
}
-
+
if (*(p++) != '-') {
return -2;
}
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index e364668..324b694 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -572,8 +572,9 @@ PyIntl_bind_textdomain_codeset(PyObject* self,PyObject*args)
if (!PyArg_ParseTuple(args, "sz", &domain, &codeset))
return NULL;
codeset = bind_textdomain_codeset(domain, codeset);
- if (codeset)
+ if (codeset) {
return PyUnicode_DecodeLocale(codeset, NULL);
+ }
Py_RETURN_NONE;
}
#endif
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 85e737b..e6a3e8e 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -449,8 +449,8 @@ search_for_exec_prefix(const _PyCoreConfig *core_config,
n = fread(buf, 1, MAXPATHLEN, f);
buf[n] = '\0';
fclose(f);
- rel_builddir_path = _Py_DecodeUTF8_surrogateescape(buf, n, NULL);
- if (rel_builddir_path != NULL) {
+ rel_builddir_path = _Py_DecodeUTF8_surrogateescape(buf, n);
+ if (rel_builddir_path) {
wcsncpy(exec_prefix, calculate->argv0_path, MAXPATHLEN);
exec_prefix[MAXPATHLEN] = L'\0';
joinpath(exec_prefix, rel_builddir_path);
diff --git a/Modules/readline.c b/Modules/readline.c
index caf661c..811fca8 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -132,13 +132,13 @@ static PyModuleDef readlinemodule;
static PyObject *
encode(PyObject *b)
{
- return _PyUnicode_EncodeCurrentLocale(b, "surrogateescape");
+ return PyUnicode_EncodeLocale(b, "surrogateescape");
}
static PyObject *
decode(const char *s)
{
- return _PyUnicode_DecodeCurrentLocale(s, "surrogateescape");
+ return PyUnicode_DecodeLocale(s, "surrogateescape");
}
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 4e7f9d9..b17ab5a 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -418,11 +418,11 @@ tmtotuple(struct tm *p
SET(8, p->tm_isdst);
#ifdef HAVE_STRUCT_TM_TM_ZONE
PyStructSequence_SET_ITEM(v, 9,
- _PyUnicode_DecodeCurrentLocale(p->tm_zone, "surrogateescape"));
+ PyUnicode_DecodeLocale(p->tm_zone, "surrogateescape"));
SET(10, p->tm_gmtoff);
#else
PyStructSequence_SET_ITEM(v, 9,
- _PyUnicode_DecodeCurrentLocale(zone, "surrogateescape"));
+ PyUnicode_DecodeLocale(zone, "surrogateescape"));
PyStructSequence_SET_ITEM(v, 10, _PyLong_FromTime_t(gmtoff));
#endif /* HAVE_STRUCT_TM_TM_ZONE */
#undef SET
@@ -809,8 +809,7 @@ time_strftime(PyObject *self, PyObject *args)
#ifdef HAVE_WCSFTIME
ret = PyUnicode_FromWideChar(outbuf, buflen);
#else
- ret = _PyUnicode_DecodeCurrentLocaleAndSize(outbuf, buflen,
- "surrogateescape");
+ ret = PyUnicode_DecodeLocaleAndSize(outbuf, buflen, "surrogateescape");
#endif
PyMem_Free(outbuf);
break;
@@ -1541,8 +1540,8 @@ PyInit_timezone(PyObject *m) {
PyModule_AddIntConstant(m, "altzone", timezone-3600);
#endif
PyModule_AddIntConstant(m, "daylight", daylight);
- otz0 = _PyUnicode_DecodeCurrentLocale(tzname[0], "surrogateescape");
- otz1 = _PyUnicode_DecodeCurrentLocale(tzname[1], "surrogateescape");
+ otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape");
+ otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape");
PyModule_AddObject(m, "tzname", Py_BuildValue("(NN)", otz0, otz1));
#else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/
{