diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-04-26 11:51:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 11:51:48 (GMT) |
commit | 6e676954de7c4f3f06dd5b56842c9a2c931a1cab (patch) | |
tree | 35fed558ff7509c31202f875deaca3c19c1f0495 /Modules/timemodule.c | |
parent | 87c07fe9d908d0a2143fcc8369255c6ff3241503 (diff) | |
download | cpython-6e676954de7c4f3f06dd5b56842c9a2c931a1cab.zip cpython-6e676954de7c4f3f06dd5b56842c9a2c931a1cab.tar.gz cpython-6e676954de7c4f3f06dd5b56842c9a2c931a1cab.tar.bz2 |
timemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294)
bpo-28769 changed PyUnicode_AsUTF8() return type from const char* to
char* in Python 3.7, but tm_zone field type of the tm structure is
char* on FreeBSD.
Cast PyUnicode_AsUTF8() to char* in gettmarg() to fix the warning:
Modules/timemodule.c:443:20: warning: assigning to 'char *'
from 'const char *' discards qualifiers
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 32062a3..15c467b 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -440,7 +440,7 @@ gettmarg(PyObject *args, struct tm *p) if (Py_TYPE(args) == &StructTimeType) { PyObject *item; item = PyTuple_GET_ITEM(args, 9); - p->tm_zone = item == Py_None ? NULL : PyUnicode_AsUTF8(item); + p->tm_zone = item == Py_None ? NULL : (char*)PyUnicode_AsUTF8(item); item = PyTuple_GET_ITEM(args, 10); p->tm_gmtoff = item == Py_None ? 0 : PyLong_AsLong(item); if (PyErr_Occurred()) |