Index: Modules/socketmodule.c =================================================================== --- Modules/socketmodule.c (revision 77774) +++ Modules/socketmodule.c (working copy) @@ -1089,6 +1089,10 @@ } #endif + default: + PyErr_SetString(PyExc_ValueError, + "Unknown Bluetooth protocol"); + return NULL; } #endif @@ -1140,8 +1144,7 @@ 0, a->scope); } else { - PyErr_SetString(PyExc_TypeError, - "Invalid address type"); + PyErr_SetString(PyExc_ValueError, "Invalid address type"); return NULL; } }