Commit 7f3dcbf5 authored by Denis Bilenko's avatar Denis Bilenko

ares.channel: in case of errors in set_servers(), __init__ no longer fails with TypeError

parent 4e58ed71
...@@ -257,12 +257,12 @@ cdef public class channel [object PyGeventAresChannelObject, type PyGeventAresCh ...@@ -257,12 +257,12 @@ cdef public class channel [object PyGeventAresChannelObject, type PyGeventAresCh
result = cares.ares_init_options(&channel, &options, optmask) result = cares.ares_init_options(&channel, &options, optmask)
if result: if result:
raise get_socket_gaierror()(result, strerror(result)) raise get_socket_gaierror()(result, strerror(result))
try: self._watchers = {}
self.channel = channel self.channel = channel
try:
if servers is not None: if servers is not None:
self.set_servers(servers) self.set_servers(servers)
self.loop = loop self.loop = loop
self._watchers = {}
except: except:
self.destroy() self.destroy()
raise raise
......
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