a subclass of it. Thanks John Lenton.
self.assertRaises(TypeError, m.write, "foo")
+ def test_error(self):
+ self.assert_(issubclass(mmap.error, EnvironmentError))
+ self.assert_("mmap.error" in str(mmap.error))
+
+
def test_main():
run_unittest(MmapTests)
Extension Modules
-----------------
+- #2112: mmap.error is now a subclass of EnvironmentError and not a
+ direct EnvironmentError
+
- Bug #2111: mmap segfaults when trying to write a block opened with PROT_READ
- #2063: correct order of utime and stime in os.times() result on Windows.
dict = PyModule_GetDict(module);
if (!dict)
return;
- mmap_module_error = PyExc_EnvironmentError;
+ mmap_module_error = PyErr_NewException("mmap.error",
+ PyExc_EnvironmentError , NULL);
+ if (mmap_module_error == NULL)
+ return;
PyDict_SetItemString(dict, "error", mmap_module_error);
PyDict_SetItemString(dict, "mmap", (PyObject*) &mmap_object_type);
#ifdef PROT_EXEC