We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b7c0ee commit ada0568Copy full SHA for ada0568
1 file changed
source/main.c
@@ -31,8 +31,13 @@ int main(int argc, char *argv[])
31
printf("Python %s on %s\n", Py_GetVersion(), Py_GetPlatform());
32
33
/* set up import path */
34
+ char cwd[PATH_MAX];
35
+ getcwd(cwd, sizeof(cwd));
36
+ /* Strip the leading sdmc: to workaround a bug somewhere... */
37
+ char *stripped_cwd = strchr(cwd, '/');
38
+ if (stripped_cwd == NULL) stripped_cwd = cwd;
39
PyObject *sysPath = PySys_GetObject("path");
- PyObject *path = PyUnicode_FromString("./");
40
+ PyObject *path = PyUnicode_FromString(cwd);
41
PyList_Insert(sysPath, 0, path);
42
43
FILE * mainpy = fopen(MAINPY, "r");
0 commit comments