summaryrefslogtreecommitdiffstats
path: root/ipapython/nsslib.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-08-12 13:44:11 +0200
committerJan Cholasta <jcholast@redhat.com>2015-09-01 11:42:01 +0200
commit8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e (patch)
treeac6435b79d3e540e907bcc88e3b1c534c2945626 /ipapython/nsslib.py
parentfb7943dab454f358316160b4baf99075603a162d (diff)
downloadfreeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.tar.gz
freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.tar.xz
freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.zip
Use the print function
In Python 3, `print` is no longer a statement. Call it as a function everywhere, and include the future import to remove the statement in Python 2 code as well. Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython/nsslib.py')
-rw-r--r--ipapython/nsslib.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py
index 1fb69cbd1..da4521894 100644
--- a/ipapython/nsslib.py
+++ b/ipapython/nsslib.py
@@ -18,6 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+from __future__ import print_function
+
import sys
import httplib
import getpass
@@ -340,9 +342,9 @@ if __name__ == "__main__":
conn.connect()
conn.request("GET", "/")
response = conn.getresponse()
- print response.status
+ print(response.status)
#print response.msg
- print response.getheaders()
+ print(response.getheaders())
data = response.read()
#print data
conn.close()
@@ -353,8 +355,8 @@ if __name__ == "__main__":
h.putrequest('GET', '/')
h.endheaders()
http_status, http_reason, headers = h.getreply()
- print "status = %s %s" % (http_status, http_reason)
- print "headers:\n%s" % headers
+ print("status = %s %s" % (http_status, http_reason))
+ print("headers:\n%s" % headers)
f = h.getfile()
data = f.read() # Get the raw HTML
f.close()