def printError(failure, hostname):
 failure.trap(error.DNSNameError)
 sys.stderr.write(('ERROR: hostname not found %r\n' % (hostname,)))

def printError ( failure , hostname ) : failure . trap ( error . DNSNameError ) sys . stderr . write ( ( 'ERROR: hostname not found %r\n' % ( hostname , ) ) )
print a friendly error message if the hostname could not be resolved .