def get_errstring(url, base='Invalid URL'):
 url_error = url.errorString()
 if url_error:
  return (base + ' - {}'.format(url_error))
 else:
  return base

def get_errstring ( url , base = 'Invalid URL' ) : url_error = url . errorString ( ) if url_error : return ( base + ' - {}' . format ( url_error ) ) else : return base
get an error string for a url .