test_capi1()
test_capi2()
+ def test_WindowsError(self):
+ try:
+ WindowsError
+ except NameError:
+ pass
+ else:
+ self.failUnlessEqual(str(WindowsError(1001)),
+ "1001")
+ self.failUnlessEqual(str(WindowsError(1001, "message")),
+ "[Error 1001] message")
+ self.failUnlessEqual(WindowsError(1001, "message").errno, 22)
+ self.failUnlessEqual(WindowsError(1001, "message").winerror, 1001)
+
def testAttributes(self):
# test that exception attributes are happy
Core and builtins
-----------------
+- Bug #1576174: WindowsError now displays the windows error code
+ again, no longer the posix error code.
+
- Patch #1549049: Support long values in structmember.
- Bug #1542016: make sys.callstats() match its docstring and return an
return NULL;
}
- if (self->myerrno) {
- Py_INCREF(self->myerrno);
- PyTuple_SET_ITEM(tuple, 0, self->myerrno);
+ if (self->winerror) {
+ Py_INCREF(self->winerror);
+ PyTuple_SET_ITEM(tuple, 0, self->winerror);
}
else {
Py_INCREF(Py_None);
Py_DECREF(fmt);
Py_DECREF(tuple);
}
- else if (self->myerrno && self->strerror) {
+ else if (self->winerror && self->strerror) {
PyObject *fmt;
PyObject *tuple;
return NULL;
}
- if (self->myerrno) {
- Py_INCREF(self->myerrno);
- PyTuple_SET_ITEM(tuple, 0, self->myerrno);
+ if (self->winerror) {
+ Py_INCREF(self->winerror);
+ PyTuple_SET_ITEM(tuple, 0, self->winerror);
}
else {
Py_INCREF(Py_None);