summaryrefslogtreecommitdiff
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-03-13 23:11:02 -0400
committerVictor Stinner <victor.stinner@haypocalc.com>2011-03-13 23:11:02 -0400
commit58d37112aef21c5533e9a5d027d00df731f62a91 (patch)
treeb3b9e0523c8d4495957ea60fcde67066f53f9c33 /Python/import.c
parent9599de5110e36f87c5017d111b3565e4a76674f0 (diff)
downloadcpython-git-58d37112aef21c5533e9a5d027d00df731f62a91.tar.gz
Issue #3080: Drop OS/2 support for the import machinery
Sorry Andrew I MacIntyre!
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/Python/import.c b/Python/import.c
index cce2de1b44..e6d7c060fe 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1804,11 +1804,6 @@ find_module_path_list(char *fullname, const char *name,
struct filedescr *fdp = NULL;
char *filemode;
FILE *fp = NULL;
-#if defined(PYOS_OS2)
- size_t saved_len;
- size_t saved_namelen;
- char *saved_buf = NULL;
-#endif
npath = PyList_Size(search_path_list);
namelen = strlen(name);
@@ -1832,40 +1827,7 @@ find_module_path_list(char *fullname, const char *name,
return fdp;
len = strlen(buf);
-#if defined(PYOS_OS2)
- /* take a snapshot of the module spec for restoration
- * after the 8 character DLL hackery
- */
- saved_buf = strdup(buf);
- saved_len = len;
- saved_namelen = namelen;
-#endif /* PYOS_OS2 */
for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
-#if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
- /* OS/2 limits DLLs to 8 character names (w/o
- extension)
- * so if the name is longer than that and its a
- * dynamically loaded module we're going to try,
- * truncate the name before trying
- */
- if (strlen(name) > 8) {
- /* is this an attempt to load a C extension? */
- const struct filedescr *scan;
- scan = _PyImport_DynLoadFiletab;
- while (scan->suffix != NULL) {
- if (!strcmp(scan->suffix, fdp->suffix))
- break;
- else
- scan++;
- }
- if (scan->suffix != NULL) {
- /* yes, so truncate the name */
- namelen = 8;
- len -= strlen(name) - namelen;
- buf[len] = '\0';
- }
- }
-#endif /* PYOS_OS2 */
strcpy(buf+len, fdp->suffix);
if (Py_VerboseFlag > 1)
PySys_WriteStderr("# trying %s\n", buf);
@@ -1881,21 +1843,7 @@ find_module_path_list(char *fullname, const char *name,
fp = NULL;
}
}
-#if defined(PYOS_OS2)
- /* restore the saved snapshot */
- strcpy(buf, saved_buf);
- len = saved_len;
- namelen = saved_namelen;
-#endif
- }
-#if defined(PYOS_OS2)
- /* don't need/want the module name snapshot anymore */
- if (saved_buf)
- {
- free(saved_buf);
- saved_buf = NULL;
}
-#endif
if (fp != NULL)
break;
}