summaryrefslogtreecommitdiff
path: root/libunbound/python/examples/mx-lookup.py
diff options
context:
space:
mode:
Diffstat (limited to 'libunbound/python/examples/mx-lookup.py')
-rw-r--r--libunbound/python/examples/mx-lookup.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libunbound/python/examples/mx-lookup.py b/libunbound/python/examples/mx-lookup.py
index f83f690f85ac..e9394b3554b5 100644
--- a/libunbound/python/examples/mx-lookup.py
+++ b/libunbound/python/examples/mx-lookup.py
@@ -33,6 +33,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
ctx = unbound.ub_ctx()
@@ -42,12 +43,12 @@ status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
print("Result:")
print(" raw data:", result.data)
- for k in result.data.mx_list:
+ for k in sorted(result.data.mx_list):
print(" priority:%d address:%s" % k)
status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
print("Result:")
print(" raw data:", result.data)
- for k in result.data.address_list:
+ for k in sorted(result.data.address_list):
print(" address:%s" % k)