summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9540b75)
raw | patch | inline | side by side (parent: 9540b75)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 5 Aug 2016 17:46:08 +0000 (19:46 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 5 Aug 2016 17:46:08 +0000 (19:46 +0200) |
Python 3 doesn't have PyUnicode_SetDefaultEncoding()
CC python_la-python.lo
python.c: In function 'cpy_config':
python.c:1138:4: error: implicit declaration of function 'PyUnicode_SetDefaultEncoding' [-Werror=implicit-function-declaration]
if (PyUnicode_SetDefaultEncoding(encoding)) {
^
cc1: all warnings being treated as errors
*** Error code 1
CC python_la-python.lo
python.c: In function 'cpy_config':
python.c:1138:4: error: implicit declaration of function 'PyUnicode_SetDefaultEncoding' [-Werror=implicit-function-declaration]
if (PyUnicode_SetDefaultEncoding(encoding)) {
^
cc1: all warnings being treated as errors
*** Error code 1
src/python.c | patch | blob | history |
diff --git a/src/python.c b/src/python.c
index deab4be111f0f33651d049037051a8ea79074cae..b991f45fd0da76994be3ae6b8e3d4e0d72849c10 100644 (file)
--- a/src/python.c
+++ b/src/python.c
continue;
}
} else if (strcasecmp(item->key, "Encoding") == 0) {
-#ifdef IS_PY3K
- ERROR("python: \"Encoding\" was used in the config file but Python3 was used, which does not support changing encodings");
- status = 1;
- continue;
-#endif
char *encoding = NULL;
if (cf_util_get_string(item, &encoding) != 0) {
status = 1;
continue;
}
+#ifdef IS_PY3K
+ ERROR("python: \"Encoding\" was used in the config file but Python3 was used, which does not support changing encodings");
+ status = 1;
+ sfree(encoding);
+ continue;
+#else
/* Why is this even necessary? And undocumented? */
if (PyUnicode_SetDefaultEncoding(encoding)) {
cpy_log_exception("setting default encoding");
status = 1;
}
+#endif
sfree(encoding);
} else if (strcasecmp(item->key, "LogTraces") == 0) {
_Bool log_traces;