Skip to content

Commit

Permalink
python: properly parse the script name
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Mar 23, 2015
1 parent 8d953eb commit 593f269
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/python/python_mod.c
Expand Up @@ -102,9 +102,6 @@ mod_init(void)
child_init_mname.len = strlen(child_init_mname.s);
}

dname = dirname(script_name.s);
if (strlen(dname) == 0)
dname = ".";
bname = basename(script_name.s);
i = strlen(bname);
if (bname[i - 1] == 'c' || bname[i - 1] == 'o')
Expand All @@ -116,6 +113,9 @@ mod_init(void)
script_name.s);
return -1;
}
dname = dirname(script_name.s);
if (strlen(dname) == 0)
dname = ".";

Py_Initialize();
PyEval_InitThreads();
Expand Down

0 comments on commit 593f269

Please sign in to comment.