Fix compilation on python2

Fix compilation error on python2.

Story: 2006796
Task: 42877

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I55de8687ed3ea844a2099974a1845f6326b77a5a
This commit is contained in:
Charles Short 2021-07-26 14:22:19 -04:00
parent 1a199b4da6
commit 085feb6096
1 changed files with 4 additions and 0 deletions

View File

@ -638,7 +638,11 @@ bool fm_db_util_sync_event_suppression(void){
Py_SetProgramName(argv[0]);
#endif
Py_Initialize();
#if PY_MAJOR_VERSION >= 3
PySys_SetArgv(argc, py_argv);
#else
PySys_SetArgv(argc, argv);
#endif
file = fopen(FM_DB_SYNC_EVENT_SUPPRESSION,"r");
PyRun_SimpleFile(file, FM_DB_SYNC_EVENT_SUPPRESSION);
fclose(file);