Package: python-vertica / 0.2.3-1

python3_compatibility.patch Patch series | download
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
Description: Python3 syntax compatibility
 Some syntax fixes with print() function and Exceptions
 to make module python3 runnable.
Author: Jean Baptiste Favre <debian@jbfavre.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: python-vertica/vertica_python/vertica/connection.py
===================================================================
--- python-vertica.orig/vertica_python/vertica/connection.py	2014-07-14 22:05:37.409188913 +0200
+++ python-vertica/vertica_python/vertica/connection.py	2014-07-14 22:06:32.729207649 +0200
@@ -131,10 +131,10 @@
             raise TypeError("invalid message: ({0})".format(message))
 
         if getattr(self, 'debug', False):
-            print "=> {0}".format(message)
+            print ( "=> {0}", format(message))
         try:
             self._socket().sendall(message.to_bytes())
-        except Exception, e:
+        except Exception as e:
             self.close_socket()
             raise errors.ConnectionError(e.message)
 
@@ -164,7 +164,7 @@
                     raise errors.MessageError("Bad message size: {0}".format(size))
                 message = BackendMessage.factory(type, self.read_bytes(size - 4))
                 if getattr(self, 'debug', False):
-                    print "<= {0}".format(message)
+                    print ("<= {0}", format(message))
                 return message
             else:
                 self.close()