- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 1fe2e45..edf3efd 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -108,6 +108,7 @@
PyAPI_DATA(PyObject *) PyExc_OverflowWarning;
PyAPI_DATA(PyObject *) PyExc_RuntimeWarning;
PyAPI_DATA(PyObject *) PyExc_FutureWarning;
+PyAPI_DATA(PyObject *) PyExc_ImportWarning;
/* Convenience functions */