Commit d840e517 authored by Antoine Pitrou's avatar Antoine Pitrou

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.
parent 98ce6200
...@@ -55,6 +55,11 @@ Core and Builtins ...@@ -55,6 +55,11 @@ Core and Builtins
Library 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. - logging: Implemented PEP 391.
- Issue #6939: Fix file I/O objects in the `io` module to keep the original - Issue #6939: Fix file I/O objects in the `io` module to keep the original
......
...@@ -1089,6 +1089,10 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto) ...@@ -1089,6 +1089,10 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
} }
#endif #endif
default:
PyErr_SetString(PyExc_ValueError,
"Unknown Bluetooth protocol");
return NULL;
} }
#endif #endif
...@@ -1140,7 +1144,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto) ...@@ -1140,7 +1144,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
0, 0,
a->scope); a->scope);
} else { } else {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_ValueError,
"Invalid address type"); "Invalid address type");
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment