From 54193cd7df6ee25ae3934adc4e7846733d4d46f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 19 Oct 2015 22:51:43 +0200 Subject: [PATCH] [Py3] Fix derefcontrol for Python3. This fixes invalid calls of print in commit 3a84c23bec0d4db25865dac4463dc4a27d628ddc --- Demo/pyasn1/derefcontrol.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Demo/pyasn1/derefcontrol.py b/Demo/pyasn1/derefcontrol.py index 4ac5155..887ce60 100644 --- a/Demo/pyasn1/derefcontrol.py +++ b/Demo/pyasn1/derefcontrol.py @@ -5,6 +5,7 @@ This sample script demonstrates the use of the dereference control Requires module pyasn1 (see http://pyasn1.sourceforge.net/) """ +from __future__ import print_function import pprint,ldap,ldap.modlist,ldap.resiter @@ -31,8 +32,8 @@ dc = DereferenceControl( } ) -print 'pyasn1 output of request control:' -print dc._derefSpecs().prettyPrint() +print('pyasn1 output of request control:') +print(dc._derefSpecs().prettyPrint()) msg_id = l.search_ext( 'dc=demo1,dc=freeipa,dc=org', @@ -45,6 +46,6 @@ msg_id = l.search_ext( for res_type,res_data,res_msgid,res_controls in l.allresults(msg_id,add_ctrls=1): for dn,entry,deref_control in res_data: # process dn and entry - print dn,entry['objectClass'] + print(dn,entry['objectClass']) if deref_control: pprint.pprint(deref_control[0].derefRes)