Commits

Anonymous committed 54e9755

Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
specified, rather than fall through to AF_PACKET (in the `socket` module).
Also, raise ValueError rather than TypeError when an unknown TIPC address
type is specified. Patch by Brian Curtin.

Comments (0)

Files changed (2)

 Library
 -------
 
+- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
+  specified, rather than fall through to AF_PACKET (in the `socket` module).
+  Also, raise ValueError rather than TypeError when an unknown TIPC address
+  type is specified.  Patch by Brian Curtin.
+
 - logging: Implemented PEP 391.
 
 - Issue #6939: Fix file I/O objects in the `io` module to keep the original

Modules/socketmodule.c

 		}
 #endif
 
+		default:
+			PyErr_SetString(PyExc_ValueError,
+					"Unknown Bluetooth protocol");
+			return NULL;
 		}
 #endif
 
 					0,
 					a->scope);
 		} else {
-			PyErr_SetString(PyExc_TypeError,
+			PyErr_SetString(PyExc_ValueError,
 					"Invalid address type");
 			return NULL;
 		}