annotate Lib/test/test_socket.py @ 6719:faebc1940432 legacy-trunk

Understand -Xlinker option.
author Guido van Rossum <guido@python.org>
date Tue, 02 Dec 1997 20:38:11 +0000
parents 94e0b31fdf5f
children aedd2d0dcb31
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
6368
94e0b31fdf5f Fixed test for socket.error to work when it's a class exception.
Guido van Rossum <guido@python.org>
parents: 5716
diff changeset
23 try: raise socket.error
94e0b31fdf5f Fixed test for socket.error to work when it's a class exception.
Guido van Rossum <guido@python.org>
parents: 5716
diff changeset
24 except socket.error: print "socket.error"
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
25
5457
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
26 socket.AF_INET
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
27
5457
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
28 socket.SOCK_STREAM
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
29 socket.SOCK_DGRAM
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
30 socket.SOCK_RAW
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
31 socket.SOCK_RDM
53440097111f Print less in test_socket.
Guido van Rossum <guido@python.org>
parents: 5060
diff changeset
32 socket.SOCK_SEQPACKET
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
33
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
34 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
35
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
36 "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
37 "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
38 "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
39 "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
40 "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
41
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
42 "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
43 "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
44 "MSG_ETAG",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
45
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
46 "SOL_SOCKET",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
47
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
48 "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
49 "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
50 "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
51 "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
52 "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
53 "IPPROTO_RAW", "IPPROTO_MAX",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
54
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
55 "IPPORT_RESERVED", "IPPORT_USERRESERVED",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
56
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
57 "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
58 "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
59 "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
60
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
61 "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
62 "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
63 "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
64 "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
65 "IP_DROP_MEMBERSHIP",
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
66 ):
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
67 missing_ok(optional)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
68
5716
ce64a8139216 socket_type --> SocketType
Fred Drake <fdrake@acm.org>
parents: 5573
diff changeset
69 socktype = socket.SocketType
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
70 hostname = socket.gethostname()
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
71 ip = socket.gethostbyname(hostname)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
72 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
73 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
74
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
75 if verbose:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
76 print hostname
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
77 print ip
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
78 print hname, aliases, ipaddrs
4940
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
79 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
80
4940
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
81 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
82 if string.find(name, '.'):
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
83 break
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
84 else:
5eed51750284 Rewrite the `hostname mismatch' test as per GvR suggestion.
Barry Warsaw <barry@python.org>
parents: 4914
diff changeset
85 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
86
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
87 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
88 try:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
89 socket.getservbyname('telnet', 'udp')
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
90 except socket.error:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
91 pass
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
92
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
93
5520
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
94 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
95 try:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
96 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
97 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
98 # parent is server
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
99 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
100 s.bind(hostname, PORT)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
101 s.listen(1)
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
102 if verbose:
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
103 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
104 if canfork:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
105 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
106 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
107 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
108 # 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
109 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
110 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
111 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
112 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
113 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
114 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
115 n = conn.getsockname()
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
116 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
117 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
118 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
119 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
120 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
121 while 1:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
122 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
123 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
124 break
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
125 if verbose:
31d66194a77c Suppress fork part of socket test when we can't fork.
Guido van Rossum <guido@python.org>
parents: 5457
diff changeset
126 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
127 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
128 conn.close()
4880
9a7e9f10aed6 Test of the socket module. The following functions and methods are
Barry Warsaw <barry@python.org>
parents:
diff changeset
129 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
130 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
131 # 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
132 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
133 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
134 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
135 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
136 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
137 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
138 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
139 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
140 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
141 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
142 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
143 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
144 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
145 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
146 raise TestFailed, msg