summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/importdl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 2c1fad0..d68b002 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -242,6 +242,12 @@ load_dynamic_module(name, pathname, fp)
void *handle;
} handles[128];
static int nhandles = 0;
+ char pathbuf[260];
+ if (strchr(pathname, '/') == NULL) {
+ /* Prefix bare filename with "./" */
+ sprintf(pathbuf, "./%-.255s", pathname);
+ pathname = pathbuf;
+ }
#endif
sprintf(funcname, FUNCNAME_PATTERN, name);
#ifdef USE_SHLIB