We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a71816a commit d832d04Copy full SHA for d832d04
_hesiod.pyx
@@ -59,14 +59,14 @@ def resolve(hes_name, hes_type):
59
cdef int i
60
cdef object py_result
61
py_result = list()
62
- cdef char ** c_result
+ cdef int err = 0
63
+ cdef char ** c_result = NULL
64
65
name_str, type_str = map(str, (hes_name, hes_type))
66
- __lookup_lock.acquire()
67
- c_result = hesiod_resolve(__context, name_str, type_str)
68
- err = errno
69
- __lookup_lock.release()
+ with __lookup_lock:
+ c_result = hesiod_resolve(__context, name_str, type_str)
+ err = errno
70
71
if c_result is NULL:
72
raise IOError(err, strerror(err))
0 commit comments