pymain_set_sys_argv() now copies argv (#4838)

bpo-29240, bpo-32030:

* Rename pymain_set_argv() to pymain_set_sys_argv()
* pymain_set_sys_argv() now creates of copy of argv and modify the
  copy, rather than modifying pymain->argv
* Call pymain_set_sys_argv() earlier: before pymain_run_python(), but
  after pymain_get_importer().
* Add _PySys_SetArgvWithError() to handle errors
This commit is contained in:
Victor Stinner 2017-12-13 17:31:16 +01:00 committed by GitHub
parent 981469794a
commit d5dda98fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 89 additions and 36 deletions

View file

@ -16,6 +16,12 @@ PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
#ifdef Py_BUILD_CORE
PyAPI_FUNC(_PyInitError) _PySys_SetArgvWithError(
int argc,
wchar_t **argv,
int updatepath);
#endif
PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)