summaryrefslogtreecommitdiff
path: root/debian/patches/0100-python_print.patch
blob: 472dc63d2d28610d327c2d71d2651e3369e36ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
Description: Change to python3 syntacs
Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
Forwarded: mailto:Uditha Atukorala <ua@nuked.zone>
Last-Update: 2015-11-21
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/modules/modpy/modules/modpy.py
===================================================================
--- trunk.orig/modules/modpy/modules/modpy.py
+++ trunk/modules/modpy/modules/modpy.py
@@ -6,15 +6,15 @@
 import bitz
 
 def init():
-	print "init() called";
+	print ("init() called");
 
 def cleanup():
-	print "cleanup() called";
+	print ("cleanup() called");
 
 def preview( request ):
 	request     = bitz.get_request( request );
 	req_payload = request['payload'];
-	print "preview payload: \r\n", req_payload;
+	print ("preview payload: \r\n", req_payload);
 
 	# response
 	if req_payload['ieof']:
@@ -27,7 +27,7 @@ def preview( request ):
 def modify( request ):
 	request     = bitz.get_request( request );
 	req_payload = request['payload'];
-	print "modify payload: \r\n", req_payload;
+	print ("modify payload: \r\n", req_payload);
 
 	# response
 	resp_payload = {};
Index: trunk/test/icap-client.py
===================================================================
--- trunk.orig/test/icap-client.py
+++ trunk/test/icap-client.py
@@ -14,16 +14,16 @@ SERVICE = 'icap://icap.server.net/sample
 PORT    = 1344
 
 # OPTIONS
-print "----- OPTIONS -----"
+print ("----- OPTIONS -----")
 try:
 	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(1)
 
 try:
 	sock.connect((HOST, PORT))
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(2)
 
@@ -40,20 +40,20 @@ while len(data):
 	data = sock.recv(1024)
 sock.close()
 
-print string
+print (string)
 
 
 # REQMOD, GET
-print "----- REQMOD - GET -----"
+print ("----- REQMOD - GET -----")
 try:
 	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(1)
 
 try:
 	sock.connect((HOST, PORT))
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(2)
 
@@ -78,20 +78,20 @@ while len(data):
 	data = sock.recv(1024)
 sock.close()
 
-print string
+print (string)
 
 
 # REQMOD, POST
-print "----- REQMOD - POST -----"
+print ("----- REQMOD - POST -----")
 try:
 	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(1)
 
 try:
 	sock.connect((HOST, PORT))
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(2)
 
@@ -118,20 +118,20 @@ while len(data):
 	data = sock.recv(1024)
 sock.close()
 
-print string
+print (string)
 
 
 # REQMOD - Message preview
-print "----- REQMOD - Message preview -----"
+print ("----- REQMOD - Message preview -----")
 try:
 	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(1)
 
 try:
 	sock.connect((HOST, PORT))
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(2)
 
@@ -158,20 +158,20 @@ while len(data):
 	data = sock.recv(1024)
 sock.close()
 
-print string
+print (string)
 
 
 # RESPMOD
-print "----- RESPMOD -----"
+print ("----- RESPMOD -----")
 try:
 	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(1)
 
 try:
 	sock.connect((HOST, PORT))
-except socket.error, msg:
+except socket.error as msg:
 	sys.stderr.write("[ERROR] %s\n" % msg[1])
 	sys.exit(2)
 
@@ -204,7 +204,7 @@ while len(data):
 	data = sock.recv(1024)
 sock.close()
 
-print string
+print (string)
 
 
 sys.exit(0)