Patch #1720595: add T_BOOL to the range of structmember types.
Patch by Angelo Mottola, reviewed by MvL, tests by me.
diff --git a/Python/structmember.c b/Python/structmember.c
index 38fc1be..d230590 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -61,6 +61,9 @@
 	}
 	addr += l->offset;
 	switch (l->type) {
+	case T_BOOL:
+		v = PyBool_FromLong(*(char*)addr);
+		break;
 	case T_BYTE:
 		v = PyInt_FromLong(*(char*)addr);
 		break;
@@ -183,6 +186,18 @@
 	}
 	addr += l->offset;
 	switch (l->type) {
+	case T_BOOL:{
+		if (!PyBool_Check(v)) {
+			PyErr_SetString(PyExc_TypeError,
+					"attribute value type must be bool");
+			return -1;
+		}
+		if (v == Py_True)
+			*(char*)addr = (char) 1;
+		else
+			*(char*)addr = (char) 0;
+		break;
+		}
 	case T_BYTE:{
 		long long_val = PyInt_AsLong(v);
 		if ((long_val == -1) && PyErr_Occurred())