Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9213f5

Browse files
committed
Merged revisions 77972 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r77972 | antoine.pitrou | 2010-02-04 21:23:24 +0100 (jeu., 04 févr. 2010) | 12 lines Merged revisions 77970 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r77970 | antoine.pitrou | 2010-02-04 21:20:18 +0100 (jeu., 04 févr. 2010) | 6 lines 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. ........ ................
1 parent a5b2873 commit c9213f5

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ Core and Builtins
7979
Library
8080
-------
8181

82+
- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
83+
specified, rather than fall through to AF_PACKET (in the `socket` module).
84+
Also, raise ValueError rather than TypeError when an unknown TIPC address
85+
type is specified. Patch by Brian Curtin.
86+
8287
- Issue #6939: Fix file I/O objects in the `io` module to keep the original
8388
file position when calling `truncate()`. It would previously change the
8489
file position to the given argument, which goes against the tradition of

Modules/socketmodule.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,10 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
10531053
}
10541054
#endif
10551055

1056+
default:
1057+
PyErr_SetString(PyExc_ValueError,
1058+
"Unknown Bluetooth protocol");
1059+
return NULL;
10561060
}
10571061
#endif
10581062

@@ -1104,7 +1108,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
11041108
0,
11051109
a->scope);
11061110
} else {
1107-
PyErr_SetString(PyExc_TypeError,
1111+
PyErr_SetString(PyExc_ValueError,
11081112
"Invalid address type");
11091113
return NULL;
11101114
}

0 commit comments

Comments
 (0)