Lines 1281-1287
python_script_selected(GntFileSel *fs, const char *path, const char *f, gpointer
Link Here
|
1281 |
{ |
1281 |
{ |
1282 |
char *dir = g_path_get_dirname(path); |
1282 |
char *dir = g_path_get_dirname(path); |
1283 |
FILE *file = fopen(path, "r"); |
1283 |
FILE *file = fopen(path, "r"); |
|
|
1284 |
#if PY_MAJOR_VERSION >= 3 |
1285 |
PyObject *pp = PySys_GetObject("path"), *dirobj = PyUnicode_FromString(dir); |
1286 |
#else |
1284 |
PyObject *pp = PySys_GetObject("path"), *dirobj = PyString_FromString(dir); |
1287 |
PyObject *pp = PySys_GetObject("path"), *dirobj = PyString_FromString(dir); |
|
|
1288 |
#endif |
1285 |
|
1289 |
|
1286 |
PyList_Insert(pp, 0, dirobj); |
1290 |
PyList_Insert(pp, 0, dirobj); |
1287 |
Py_DECREF(dirobj); |
1291 |
Py_DECREF(dirobj); |