From: Willem Toorop Date: Wed, 13 Apr 2011 14:54:00 +0000 (+0000) Subject: Make python function ldns_ldns_get_addr_by_name accept string parameters too (such... X-Git-Tag: release-1.6.10rc1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e7a7b57a9370782e232a466b87efea8b15576b2;p=thirdparty%2Fldns.git Make python function ldns_ldns_get_addr_by_name accept string parameters too (such as in the example in the documentation). --- diff --git a/contrib/python/ldns_resolver.i b/contrib/python/ldns_resolver.i index dd3ed55e..0ddcb4e9 100644 --- a/contrib/python/ldns_resolver.i +++ b/contrib/python/ldns_resolver.i @@ -166,7 +166,10 @@ This simple example instances a resolver in order to resolve www.nic.cz record o www.l.google.com. 300 IN A 74.125.43.147 """ - return _ldns.ldns_get_rr_list_addr_by_name(self, name, aclass, flags) + rdf = name + if isinstance(name, str): + rdf = _ldns.ldns_dname_new_frm_str(name) + return _ldns.ldns_get_rr_list_addr_by_name(self, rdf, aclass, flags) def get_name_by_addr(self, addr, aclass = _ldns.LDNS_RR_CLASS_IN, flags = _ldns.LDNS_RD): """Ask the resolver about the address and return the name