summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-02-04 20:23:24 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-02-04 20:23:24 (GMT)
commitb6375f12664f32f9c997609adab6e73c58721c69 (patch)
treeb8e67d29a12236fa64e3c1f8f6afc9f4b55b2f9b /Modules/socketmodule.c
parent8f0b31ae4c32a32ee92e0464465172e4e2541b48 (diff)
downloadcpython-b6375f12664f32f9c997609adab6e73c58721c69.zip
cpython-b6375f12664f32f9c997609adab6e73c58721c69.tar.gz
cpython-b6375f12664f32f9c997609adab6e73c58721c69.tar.bz2
Merged revisions 77970 via svnmerge from
svn+ssh://pythondev@svn.python.org/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. ........
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index fa543cd..e65303b 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1053,6 +1053,10 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
}
#endif
+ default:
+ PyErr_SetString(PyExc_ValueError,
+ "Unknown Bluetooth protocol");
+ return NULL;
}
#endif
@@ -1104,7 +1108,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;
}