[pykd_ext_2.0] fixed : issue #14086 (invalid sys.argv values )

git-svn-id: https://pykd.svn.codeplex.com/svn@91206 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\ussrhero_cp 2017-04-07 19:29:17 +00:00 committed by Mikhail I. Izmestev
parent 67966b169b
commit ee8236c524
2 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@
#define PYKDEXT_VERSION_MAJOR 2
#define PYKDEXT_VERSION_MINOR 0
#define PYKDEXT_VERSION_SUBVERSION 0
#define PYKDEXT_VERSION_BUILDNO 10
#define PYKDEXT_VERSION_BUILDNO 11
#define __VER_STR2__(x) #x
#define __VER_STR1__(x) __VER_STR2__(x)

View File

@ -387,18 +387,19 @@ py(
if (IsPy3())
{
// óñòàíàâèëèâàåì ïèòîíîâñêèå àðãóìåíòû
std::vector<wchar_t*> pythonArgs(opts.args.size());
std::wstring scriptFileNameW = _bstr_t(scriptFileName.c_str());
pythonArgs[0] = const_cast<wchar_t*>(scriptFileNameW.c_str());
// óñòàíàâèëèâàåì ïèòîíîâñêèå àðãóìåíòû
std::vector<std::wstring> argws(opts.args.size());
argws[0] = scriptFileNameW;
for (size_t i = 1; i < opts.args.size(); ++i)
{
std::wstring argw = _bstr_t(opts.args[i].c_str());
pythonArgs[i] = const_cast<wchar_t*>(argw.c_str());
}
argws[i] = _bstr_t(opts.args[i].c_str());
std::vector<wchar_t*> pythonArgs(opts.args.size());
for (size_t i = 0; i < opts.args.size(); ++i)
pythonArgs[i] = const_cast<wchar_t*>(argws[i].c_str());
PySys_SetArgv_Py3((int)opts.args.size(), &pythonArgs[0]);