aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/pythonmod/pythonmod.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-05-31 16:38:19 +0200
committerRiccardo Spagni <ric@spagni.net>2015-05-31 16:38:21 +0200
commit431397abfaf37b28c6981242d7fd59d8e520c8ec (patch)
treefa324d2f9f02668a6d56d2e4d195a59ab1d3710e /external/unbound/pythonmod/pythonmod.c
parentafb225b3ce570eca0c50fc56dd32b38d9c1a0758 (diff)
parent6a1190792b0409e7a996400614e5e2c6ba02e5f6 (diff)
downloadmonzero-core-431397abfaf37b28c6981242d7fd59d8e520c8ec.tar.gz
monzero-core-431397abfaf37b28c6981242d7fd59d8e520c8ec.tar.xz
monzero-core-431397abfaf37b28c6981242d7fd59d8e520c8ec.zip
Merge pull request #302
6a11907 update libunbound (Riccardo Spagni)
Diffstat (limited to 'external/unbound/pythonmod/pythonmod.c')
-rw-r--r--external/unbound/pythonmod/pythonmod.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/external/unbound/pythonmod/pythonmod.c b/external/unbound/pythonmod/pythonmod.c
index 190d41a81..48dbc0169 100644
--- a/external/unbound/pythonmod/pythonmod.c
+++ b/external/unbound/pythonmod/pythonmod.c
@@ -133,7 +133,13 @@ int pythonmod_init(struct module_env* env, int id)
/* Initialize Python libraries */
if (!Py_IsInitialized())
{
- Py_SetProgramName("unbound");
+#if PY_MAJOR_VERSION >= 3
+ wchar_t progname[8];
+ mbstowcs(progname, "unbound", 8);
+#else
+ char *progname = "unbound";
+#endif
+ Py_SetProgramName(progname);
Py_NoSiteFlag = 1;
Py_Initialize();
PyEval_InitThreads();