summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-21 06:01:18 (GMT)
committerGeorg Brandl <georg@python.org>2007-08-21 06:01:18 (GMT)
commitfdca6d8599e46ee7fc7844a798666fc60923fbe5 (patch)
tree238caa41f0e2edce919e55b1d658330415036caa /Python/import.c
parent1bb124ad0d9a81664170d9a41c6c8128ceafbc33 (diff)
downloadcpython-fdca6d8599e46ee7fc7844a798666fc60923fbe5.zip
cpython-fdca6d8599e46ee7fc7844a798666fc60923fbe5.tar.gz
cpython-fdca6d8599e46ee7fc7844a798666fc60923fbe5.tar.bz2
Demand version 2.5.1 since 2.5 has a bug with codecs.open context managers.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 678a30b..dc97940 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1395,6 +1395,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
filemode = fdp->mode;
if (filemode[0] == 'U')
filemode = "r" PY_STDIOTEXTMODE;
+ errno = 0;
fp = fopen(buf, filemode);
if (fp != NULL) {
if (case_ok(buf, len, namelen, name))
@@ -1404,6 +1405,15 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
fp = NULL;
}
}
+ /* issue a warning if the file is there */
+ /*if (errno != ENOENT) {
+ char warnstr[MAXPATHLEN+80];
+ sprintf(warnstr, "Not importing '%.*s': ");
+
+ if (PyErr_Warn(PyExc_ImportWarning,
+ warnstr)) {
+
+ }*/
#if defined(PYOS_OS2)
/* restore the saved snapshot */
strcpy(buf, saved_buf);