annotate Lib/test/test_socket.py @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents ce64a8139216
children 94e0b31fdf5f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
1 # Not tested:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
2 # socket.fromfd()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
3 # sktobj.getsockopt()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
4 # sktobj.recvfrom()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
5 # sktobj.sendto()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
6 # sktobj.setblocking()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
7 # sktobj.setsockopt()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
8 # sktobj.shutdown()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
9
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
10
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
11 from test_support import verbose, TestFailed
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
12 import socket
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
13 import os
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
14 import time
4940
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
15 import string
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
16
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
17 def missing_ok(str):
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
18 try:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
19 getattr(socket, str)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
20 except AttributeError:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
21 pass
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
22
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
23 print socket.error
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
24
5457
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
25 socket.AF_INET
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
26
5457
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
27 socket.SOCK_STREAM
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
28 socket.SOCK_DGRAM
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
29 socket.SOCK_RAW
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
30 socket.SOCK_RDM
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
31 socket.SOCK_SEQPACKET
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
32
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
33 for optional in ("AF_UNIX",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
34
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
35 "SO_DEBUG", "SO_ACCEPTCONN", "SO_REUSEADDR", "SO_KEEPALIVE",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
36 "SO_DONTROUTE", "SO_BROADCAST", "SO_USELOOPBACK", "SO_LINGER",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
37 "SO_OOBINLINE", "SO_REUSEPORT", "SO_SNDBUF", "SO_RCVBUF",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
38 "SO_SNDLOWAT", "SO_RCVLOWAT", "SO_SNDTIMEO", "SO_RCVTIMEO",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
39 "SO_ERROR", "SO_TYPE", "SOMAXCONN",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
40
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
41 "MSG_OOB", "MSG_PEEK", "MSG_DONTROUTE", "MSG_EOR",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
42 "MSG_TRUNC", "MSG_CTRUNC", "MSG_WAITALL", "MSG_BTAG",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
43 "MSG_ETAG",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
44
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
45 "SOL_SOCKET",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
46
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
47 "IPPROTO_IP", "IPPROTO_ICMP", "IPPROTO_IGMP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
48 "IPPROTO_GGP", "IPPROTO_TCP", "IPPROTO_EGP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
49 "IPPROTO_PUP", "IPPROTO_UDP", "IPPROTO_IDP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
50 "IPPROTO_HELLO", "IPPROTO_ND", "IPPROTO_TP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
51 "IPPROTO_XTP", "IPPROTO_EON", "IPPROTO_BIP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
52 "IPPROTO_RAW", "IPPROTO_MAX",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
53
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
54 "IPPORT_RESERVED", "IPPORT_USERRESERVED",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
55
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
56 "INADDR_ANY", "INADDR_BROADCAST", "INADDR_LOOPBACK",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
57 "INADDR_UNSPEC_GROUP", "INADDR_ALLHOSTS_GROUP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
58 "INADDR_MAX_LOCAL_GROUP", "INADDR_NONE",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
59
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
60 "IP_OPTIONS", "IP_HDRINCL", "IP_TOS", "IP_TTL",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
61 "IP_RECVOPTS", "IP_RECVRETOPTS", "IP_RECVDSTADDR",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
62 "IP_RETOPTS", "IP_MULTICAST_IF", "IP_MULTICAST_TTL",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
63 "IP_MULTICAST_LOOP", "IP_ADD_MEMBERSHIP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
64 "IP_DROP_MEMBERSHIP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
65 ):
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
66 missing_ok(optional)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
67
5716
ce64a8139216 socket_type --> SocketType
Fred Drake <fdrake@acm.org>
parents: 5573
diff changeset
68 socktype = socket.SocketType
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
69 hostname = socket.gethostname()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
70 ip = socket.gethostbyname(hostname)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
71 hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
4940
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
72 all_host_names = [hname] + aliases
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
73
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
74 if verbose:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
75 print hostname
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
76 print ip
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
77 print hname, aliases, ipaddrs
4940
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
78 print all_host_names
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
79
4940
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
80 for name in all_host_names:
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
81 if string.find(name, '.'):
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
82 break
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
83 else:
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
84 print 'FQDN not found'
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
85
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
86 print socket.getservbyname('telnet', 'tcp')
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
87 try:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
88 socket.getservbyname('telnet', 'udp')
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
89 except socket.error:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
90 pass
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
91
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
92
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
93 canfork = hasattr(os, 'fork')
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
94 try:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
95 PORT = 50007
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
96 if not canfork or os.fork():
4914
250bddb2eccf Added an os._exit(0) in the parent so we don't have two test processes
Barry Warsaw <barry@python.org>
parents: 4880
diff changeset
97 # parent is server
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
98 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
99 s.bind(hostname, PORT)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
100 s.listen(1)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
101 if verbose:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
102 print 'parent accepting'
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
103 if canfork:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
104 conn, addr = s.accept()
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
105 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
106 print 'connected by', addr
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
107 # couple of interesting tests while we've got a live socket
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
108 f = conn.fileno()
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
109 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
110 print 'fileno:', f
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
111 p = conn.getpeername()
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
112 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
113 print 'peer:', p
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
114 n = conn.getsockname()
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
115 if verbose:
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
116 print 'sockname:', n
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
117 f = conn.makefile()
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
118 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
119 print 'file obj:', f
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
120 while 1:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
121 data = conn.recv(1024)
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
122 if not data:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
123 break
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
124 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
125 print 'received:', data
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
126 conn.send(data)
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
127 conn.close()
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
128 else:
4986
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
129 try:
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
130 # child is client
5538
472c8e4cc974 Increase the child's sleep time to 5 for slow machines.
Guido van Rossum <guido@python.org>
parents: 5520
diff changeset
131 time.sleep(5)
4986
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
132 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
133 if verbose:
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
134 print 'child connecting'
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
135 s.connect(hostname, PORT)
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
136 msg = 'socket test'
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
137 s.send(msg)
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
138 data = s.recv(1024)
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
139 if msg <> data:
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
140 print 'parent/client mismatch'
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
141 s.close()
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
142 finally:
d8d563baf874 Make as sure as we can that the forked child does not return and
Guido van Rossum <guido@python.org>
parents: 4940
diff changeset
143 os._exit(1)
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
144 except socket.error, msg:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
145 raise TestFailed, msg