diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-02-04 20:20:18 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-02-04 20:20:18 (GMT) |
commit | d840e5174dc8d5407b56e377aa1e608ebe5cf535 (patch) | |
tree | e7e0e2bbe746be845867ea2a013544f4f2c75478 /Modules/socketmodule.c | |
parent | 98ce620068c7f164f5a1d95749c7a7d359cc5921 (diff) | |
download | cpython-d840e5174dc8d5407b56e377aa1e608ebe5cf535.zip cpython-d840e5174dc8d5407b56e377aa1e608ebe5cf535.tar.gz cpython-d840e5174dc8d5407b56e377aa1e608ebe5cf535.tar.bz2 |
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.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 396a43d..a993e88 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -1089,6 +1089,10 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto) } #endif + default: + PyErr_SetString(PyExc_ValueError, + "Unknown Bluetooth protocol"); + return NULL; } #endif @@ -1140,7 +1144,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto) 0, a->scope); } else { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_ValueError, "Invalid address type"); return NULL; } |