Commit 39a8da41 authored by Barry Warsaw's avatar Barry Warsaw

Make socket.getservbyname test optional on socket module having that

attribute.  Jython does not have this function.

Closes SF patch #403667.
parent de687bd3
...@@ -83,11 +83,12 @@ for name in all_host_names: ...@@ -83,11 +83,12 @@ for name in all_host_names:
else: else:
print 'FQDN not found' print 'FQDN not found'
print socket.getservbyname('telnet', 'tcp') if hasattr(socket, 'getservbyname'):
try: print socket.getservbyname('telnet', 'tcp')
socket.getservbyname('telnet', 'udp') try:
except socket.error: socket.getservbyname('telnet', 'udp')
pass except socket.error:
pass
canfork = hasattr(os, 'fork') canfork = hasattr(os, 'fork')
......
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