def IsURLErrorFatal(error):
 assert isinstance(error, urllib2.URLError)
 if (not hasattr(error, 'reason')):
  return True
 if (not isinstance(error.reason[0], int)):
  return True
 return (error.reason[0] not in non_fatal_error_codes)

def IsURLErrorFatal ( error ) : assert isinstance ( error , urllib2 . URLError ) if ( not hasattr ( error , 'reason' ) ) : return True if ( not isinstance ( error . reason [ 0 ] , int ) ) : return True return ( error . reason [ 0 ] not in non_fatal_error_codes )
returns false if the given urlerror may be from a transient failure .