From a301e831298612479e2d93b8da3ba65597fa2bf9 Mon Sep 17 00:00:00 2001 From: Vincent Castellano Date: Thu, 7 May 2015 01:54:17 -0700 Subject: [PATCH] support a path to the python script. TODO: get rid of gcc warn --- python-tg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-tg.c b/python-tg.c index b1977a4..131c754 100644 --- a/python-tg.c +++ b/python-tg.c @@ -1320,7 +1320,7 @@ void py_init (const char *file) { char* dot = strrchr(file, '.'); if (dot && strcmp(dot, ".py") == 0) *dot = 0; - pModule = PyImport_Import(PyString_FromString(file)); + pModule = PyImport_Import(PyString_FromString(basename(file))); if(pModule == NULL || PyErr_Occurred()) { // Error loading script logprintf("Failed to load python script\n");