1
0
mirror of https://github.com/thp/pyotherside.git synced 2025-01-28 23:52:55 +08:00

Merge pull request #106 from uglide/patch-1

Fix compilation on Windows with VS 2017
This commit is contained in:
Thomas Perl 2019-06-19 14:00:30 +02:00 committed by GitHub
commit 1a32320c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -519,10 +519,11 @@ QPythonPriv::QPythonPriv()
// Initialize sys.argv (https://github.com/thp/pyotherside/issues/77)
int argc = 1;
wchar_t *argv[argc];
wchar_t **argv = (wchar_t **)malloc(argc * sizeof(wchar_t *));
argv[0] = Py_DecodeLocale("", nullptr);
PySys_SetArgvEx(argc, argv, 0);
PyMem_RawFree((void *)argv[0]);
free(argv);
locals = PyObjectRef(PyDict_New(), true);
assert(locals);