def set_connected(): try: # try to flush resolver cache - SL#1940 # ctypes' syntactic sugar does not work # so we must get the func ptr explicitly libc = ctypes.CDLL('libc.so.6') res_init = getattr(libc, '__res_init') res_init(None) except: # pylint: disable=W0702 logging.exception('Error calling libc.__res_init') check_urgent_update()
def set_connected(): try: # try to flush resolver cache - SL#1940 # ctypes' syntactic sugar does not work # so we must get the func ptr explicitly libc = ctypes.CDLL('libc.so.6') res_init = getattr(libc, '__res_init') res_init(None) except: # pylint: disable=W0702 logging.exception('Error calling libc.__res_init') check_urgent_update()