From 6766de6c893d5300bac773bbd654c5af06c2ab66 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Sat, 8 Oct 2016 23:32:06 -0600 Subject: switch to pythonlibs 3 --- src/chill.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/chill.cc') diff --git a/src/chill.cc b/src/chill.cc index 9901fab..45d53f1 100644 --- a/src/chill.cc +++ b/src/chill.cc @@ -35,14 +35,15 @@ int main(int argc, char *argv[]) { // Create PYTHON interpreter /* Pass argv[0] to the Python interpreter */ - Py_SetProgramName(argv[0]); - - /* Initialize the Python interpreter. Required. */ - Py_Initialize(); + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + Py_SetProgramName(program); /* Add a static module */ initchill(); + /* Initialize the Python interpreter. Required. */ + Py_Initialize(); + if (argc == 2) { FILE *f = fopen(argv[1], "r"); if (!f) { -- cgit v1.2.3-70-g09d2