[Python-modules-commits] [python-vertica] 03/08: remove deprecated import for python 3

Jean Baptiste Favre jbfavre-guest at moszumanska.debian.org
Sun Apr 10 15:54:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

jbfavre-guest pushed a commit to branch master
in repository python-vertica.

commit 1073fb22a17118aad454aedce26c510115984f1e
Author: Jean Baptiste Favre <debian at jbfavre.org>
Date:   Thu Oct 8 13:20:49 2015 -0700

    remove deprecated import for python 3
    
    Origin: other
    Reviewed-by: Jean Baptiste Favre <debian at jbfavre.org>
    Last-Update: 2015-08-16
    Patch-Name: fix_python3_compatibility.patch
---
 vertica_python/__init__.py                         |  2 +-
 vertica_python/datatypes.py                        |  2 +-
 vertica_python/errors.py                           | 10 ++--
 vertica_python/tests/basic_tests.py                |  2 +-
 vertica_python/tests/date_tests.py                 |  2 +-
 vertica_python/vertica/column.py                   |  6 +-
 vertica_python/vertica/connection.py               | 11 ++--
 vertica_python/vertica/cursor.py                   |  6 +-
 vertica_python/vertica/messages/__init__.py        | 70 +++++++++++-----------
 .../messages/backend_messages/authentication.py    |  2 +-
 .../messages/backend_messages/backend_key_data.py  |  2 +-
 .../messages/backend_messages/bind_complete.py     |  2 +-
 .../messages/backend_messages/close_complete.py    |  2 +-
 .../messages/backend_messages/command_complete.py  |  2 +-
 .../messages/backend_messages/copy_in_response.py  |  2 +-
 .../vertica/messages/backend_messages/data_row.py  |  4 +-
 .../backend_messages/empty_query_response.py       |  2 +-
 .../messages/backend_messages/error_response.py    |  2 +-
 .../vertica/messages/backend_messages/no_data.py   |  2 +-
 .../messages/backend_messages/notice_response.py   |  2 +-
 .../backend_messages/parameter_description.py      |  2 +-
 .../messages/backend_messages/parameter_status.py  |  2 +-
 .../messages/backend_messages/parse_complete.py    |  2 +-
 .../messages/backend_messages/portal_suspended.py  |  2 +-
 .../messages/backend_messages/ready_for_query.py   |  2 +-
 .../messages/backend_messages/row_description.py   |  4 +-
 .../vertica/messages/backend_messages/unknown.py   |  2 +-
 .../vertica/messages/frontend_messages/bind.py     |  4 +-
 .../messages/frontend_messages/cancel_request.py   |  2 +-
 .../vertica/messages/frontend_messages/close.py    |  2 +-
 .../messages/frontend_messages/copy_data.py        |  2 +-
 .../messages/frontend_messages/copy_done.py        |  2 +-
 .../messages/frontend_messages/copy_fail.py        |  2 +-
 .../messages/frontend_messages/copy_stream.py      |  2 +-
 .../vertica/messages/frontend_messages/describe.py |  2 +-
 .../vertica/messages/frontend_messages/execute.py  |  2 +-
 .../vertica/messages/frontend_messages/flush.py    |  2 +-
 .../vertica/messages/frontend_messages/parse.py    |  2 +-
 .../vertica/messages/frontend_messages/password.py |  2 +-
 .../vertica/messages/frontend_messages/query.py    |  4 +-
 .../messages/frontend_messages/ssl_request.py      |  2 +-
 .../vertica/messages/frontend_messages/startup.py  |  2 +-
 .../vertica/messages/frontend_messages/sync.py     |  2 +-
 .../messages/frontend_messages/terminate.py        |  2 +-
 vertica_python/vertica/messages/message.py         |  2 +-
 45 files changed, 97 insertions(+), 94 deletions(-)

diff --git a/vertica_python/__init__.py b/vertica_python/__init__.py
index 5a7dc99..1a751da 100644
--- a/vertica_python/__init__.py
+++ b/vertica_python/__init__.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.connection import Connection
 
diff --git a/vertica_python/datatypes.py b/vertica_python/datatypes.py
index c459295..89fe296 100644
--- a/vertica_python/datatypes.py
+++ b/vertica_python/datatypes.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from datetime import datetime
 from datetime import timedelta
diff --git a/vertica_python/errors.py b/vertica_python/errors.py
index 1b9f842..28bc605 100644
--- a/vertica_python/errors.py
+++ b/vertica_python/errors.py
@@ -1,14 +1,16 @@
-from __future__ import absolute_import
 
-import exceptions
+
+import sys
+if sys.version_info < (3,):
+    import exceptions
 import re
 
 
-class Error(exceptions.StandardError):
+class Error(Exception):
     pass
 
 
-class Warning(exceptions.StandardError):
+class Warning(Exception):
     pass
 
 
diff --git a/vertica_python/tests/basic_tests.py b/vertica_python/tests/basic_tests.py
index 0593e40..9627c43 100644
--- a/vertica_python/tests/basic_tests.py
+++ b/vertica_python/tests/basic_tests.py
@@ -2,7 +2,7 @@ import unittest
 import logging
 import tempfile
 
-from test_commons import conn_info
+from .test_commons import conn_info
 
 import vertica_python
 from vertica_python import errors
diff --git a/vertica_python/tests/date_tests.py b/vertica_python/tests/date_tests.py
index 90e4486..4477165 100644
--- a/vertica_python/tests/date_tests.py
+++ b/vertica_python/tests/date_tests.py
@@ -1,5 +1,5 @@
 from datetime import date, datetime
-from test_commons import *
+from .test_commons import *
 from vertica_python import errors
 from vertica_python.vertica.column import timestamp_parse
 
diff --git a/vertica_python/vertica/column.py b/vertica_python/vertica/column.py
index 7dd4df5..52e3e55 100644
--- a/vertica_python/vertica/column.py
+++ b/vertica_python/vertica/column.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from collections import namedtuple
 import re
@@ -81,7 +81,7 @@ def date_parse(s):
     if s.endswith(' BC'):
         raise errors.NotSupportedError('Dates Before Christ are not supported. Got: ' + s)
 
-    return date(*map(lambda x: int(x), s.split('-')))
+    return date(*[int(x) for x in s.split('-')])
 
 ColumnTuple = namedtuple(
     'Column',
@@ -165,7 +165,7 @@ class Column(object):
         return self.props.__str__()
 
     def __unicode__(self):
-        return unicode(self.props.__str__())
+        return str(self.props.__str__())
 
     def __repr__(self):
         return self.props.__str__()
diff --git a/vertica_python/vertica/connection.py b/vertica_python/vertica/connection.py
index 8bc9a1e..7176f48 100644
--- a/vertica_python/vertica/connection.py
+++ b/vertica_python/vertica/connection.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import logging
 import select
@@ -14,6 +14,7 @@ from vertica_python.vertica.messages.message import BackendMessage
 
 from vertica_python.vertica.cursor import Cursor
 from vertica_python.errors import SSLNotSupported
+import collections
 
 logger = logging.getLogger('vertica')
 
@@ -24,7 +25,7 @@ class Connection(object):
 
         options = options or {}
         self.options = dict(
-            (key, value) for key, value in options.iteritems() if value is not None
+            (key, value) for key, value in options.items() if value is not None
         )
 
         # we only support one cursor per connection
@@ -134,7 +135,7 @@ class Connection(object):
 
         is_stream = hasattr(message, "read_bytes")
 
-        if (hasattr(message, 'to_bytes') is False or callable(getattr(message, 'to_bytes')) is False) and not is_stream:
+        if (hasattr(message, 'to_bytes') is False or isinstance(getattr(message, 'to_bytes'), collections.Callable) is False) and not is_stream:
             raise TypeError("invalid message: ({0})".format(message))
 
         logger.debug('=> %s', message)
@@ -151,7 +152,7 @@ class Connection(object):
 
                     self._socket().sendall(data)
 
-        except Exception, e:
+        except Exception as e:
             self.close_socket()
             if e.message == 'unsupported authentication method: 9':
                 raise errors.ConnectionError('Error during authentication. Your password might be expired.')
@@ -221,7 +222,7 @@ class Connection(object):
 
     def __str__(self):
         safe_options = dict(
-            (key, value) for key, value in self.options.iteritems() if key != 'password'
+            (key, value) for key, value in self.options.items() if key != 'password'
         )
         s1 = "<Vertica.Connection:{0} parameters={1} backend_pid={2}, ".format(
             id(self), self.parameters, self.backend_pid
diff --git a/vertica_python/vertica/cursor.py b/vertica_python/vertica/cursor.py
index 4389951..c4a0381 100644
--- a/vertica_python/vertica/cursor.py
+++ b/vertica_python/vertica/cursor.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import re
 import logging
@@ -57,7 +57,7 @@ class Cursor(object):
                 for key in parameters:
                     param = parameters[key]
                     # Make sure adapt() behaves properly
-                    if isinstance(param, unicode):
+                    if isinstance(param, str):
                         v = adapt(param.encode('utf8')).getquoted()
                     else:
                         v = adapt(param).getquoted()
@@ -69,7 +69,7 @@ class Cursor(object):
             elif isinstance(parameters, tuple):
                 tlist = []
                 for p in parameters:
-                    if isinstance(p, unicode):
+                    if isinstance(p, str):
                         tlist.append(adapt(p.encode('utf8')).getquoted())
                     else:
                         tlist.append(adapt(p).getquoted())
diff --git a/vertica_python/vertica/messages/__init__.py b/vertica_python/vertica/messages/__init__.py
index d15ed69..7168246 100644
--- a/vertica_python/vertica/messages/__init__.py
+++ b/vertica_python/vertica/messages/__init__.py
@@ -1,39 +1,39 @@
-from backend_messages.authentication import Authentication
-from backend_messages.backend_key_data import BackendKeyData
-from backend_messages.bind_complete import BindComplete
-from backend_messages.close_complete import CloseComplete
-from backend_messages.command_complete import CommandComplete
-from backend_messages.copy_in_response import CopyInResponse
-from backend_messages.data_row import DataRow
-from backend_messages.empty_query_response import EmptyQueryResponse
-from backend_messages.error_response import ErrorResponse
-from backend_messages.no_data import NoData
-from backend_messages.notice_response import NoticeResponse
-from backend_messages.parameter_description import ParameterDescription
-from backend_messages.parameter_status import ParameterStatus
-from backend_messages.parse_complete import ParseComplete
-from backend_messages.portal_suspended import PortalSuspended
-from backend_messages.ready_for_query import ReadyForQuery
-from backend_messages.row_description import RowDescription
-from backend_messages.unknown import Unknown
+from .backend_messages.authentication import Authentication
+from .backend_messages.backend_key_data import BackendKeyData
+from .backend_messages.bind_complete import BindComplete
+from .backend_messages.close_complete import CloseComplete
+from .backend_messages.command_complete import CommandComplete
+from .backend_messages.copy_in_response import CopyInResponse
+from .backend_messages.data_row import DataRow
+from .backend_messages.empty_query_response import EmptyQueryResponse
+from .backend_messages.error_response import ErrorResponse
+from .backend_messages.no_data import NoData
+from .backend_messages.notice_response import NoticeResponse
+from .backend_messages.parameter_description import ParameterDescription
+from .backend_messages.parameter_status import ParameterStatus
+from .backend_messages.parse_complete import ParseComplete
+from .backend_messages.portal_suspended import PortalSuspended
+from .backend_messages.ready_for_query import ReadyForQuery
+from .backend_messages.row_description import RowDescription
+from .backend_messages.unknown import Unknown
 
-from frontend_messages.bind import Bind
-from frontend_messages.cancel_request import CancelRequest
-from frontend_messages.close import Close
-from frontend_messages.copy_data import CopyData
-from frontend_messages.copy_stream import CopyStream
-from frontend_messages.copy_done import CopyDone
-from frontend_messages.copy_fail import CopyFail
-from frontend_messages.describe import Describe
-from frontend_messages.execute import Execute
-from frontend_messages.flush import Flush
-from frontend_messages.parse import Parse
-from frontend_messages.password import Password
-from frontend_messages.query import Query
-from frontend_messages.ssl_request import SslRequest
-from frontend_messages.startup import Startup
-from frontend_messages.sync import Sync
-from frontend_messages.terminate import Terminate
+from .frontend_messages.bind import Bind
+from .frontend_messages.cancel_request import CancelRequest
+from .frontend_messages.close import Close
+from .frontend_messages.copy_data import CopyData
+from .frontend_messages.copy_stream import CopyStream
+from .frontend_messages.copy_done import CopyDone
+from .frontend_messages.copy_fail import CopyFail
+from .frontend_messages.describe import Describe
+from .frontend_messages.execute import Execute
+from .frontend_messages.flush import Flush
+from .frontend_messages.parse import Parse
+from .frontend_messages.password import Password
+from .frontend_messages.query import Query
+from .frontend_messages.ssl_request import SslRequest
+from .frontend_messages.startup import Startup
+from .frontend_messages.sync import Sync
+from .frontend_messages.terminate import Terminate
 
 __all__ = ["Authentication", "BackendKeyData", "BindComplete", "CloseComplete", "CommandComplete",
            "CopyInResponse", "DataRow", "EmptyQueryResponse", "ErrorResponse", "NoData", "NoticeResponse",
diff --git a/vertica_python/vertica/messages/backend_messages/authentication.py b/vertica_python/vertica/messages/backend_messages/authentication.py
index 54add1a..6575207 100644
--- a/vertica_python/vertica/messages/backend_messages/authentication.py
+++ b/vertica_python/vertica/messages/backend_messages/authentication.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import unpack
 
diff --git a/vertica_python/vertica/messages/backend_messages/backend_key_data.py b/vertica_python/vertica/messages/backend_messages/backend_key_data.py
index 317d450..ce1ce52 100644
--- a/vertica_python/vertica/messages/backend_messages/backend_key_data.py
+++ b/vertica_python/vertica/messages/backend_messages/backend_key_data.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import unpack
 
diff --git a/vertica_python/vertica/messages/backend_messages/bind_complete.py b/vertica_python/vertica/messages/backend_messages/bind_complete.py
index 5d25e1d..e2510da 100644
--- a/vertica_python/vertica/messages/backend_messages/bind_complete.py
+++ b/vertica_python/vertica/messages/backend_messages/bind_complete.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/backend_messages/close_complete.py b/vertica_python/vertica/messages/backend_messages/close_complete.py
index fea59dd..bf138c1 100644
--- a/vertica_python/vertica/messages/backend_messages/close_complete.py
+++ b/vertica_python/vertica/messages/backend_messages/close_complete.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/backend_messages/command_complete.py b/vertica_python/vertica/messages/backend_messages/command_complete.py
index 92873f2..ab0be2c 100644
--- a/vertica_python/vertica/messages/backend_messages/command_complete.py
+++ b/vertica_python/vertica/messages/backend_messages/command_complete.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import re
 
diff --git a/vertica_python/vertica/messages/backend_messages/copy_in_response.py b/vertica_python/vertica/messages/backend_messages/copy_in_response.py
index 1566035..78ea2ca 100644
--- a/vertica_python/vertica/messages/backend_messages/copy_in_response.py
+++ b/vertica_python/vertica/messages/backend_messages/copy_in_response.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import unpack
 
diff --git a/vertica_python/vertica/messages/backend_messages/data_row.py b/vertica_python/vertica/messages/backend_messages/data_row.py
index 52eec1a..163b19d 100644
--- a/vertica_python/vertica/messages/backend_messages/data_row.py
+++ b/vertica_python/vertica/messages/backend_messages/data_row.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import unpack, unpack_from
 
@@ -12,7 +12,7 @@ class DataRow(BackendMessage):
         field_count = unpack('!H', data[0:2])[0]
         pos = 2
 
-        for i in xrange(field_count):
+        for i in range(field_count):
             size = unpack_from('!I', data, pos)[0]
 
             if size == 4294967295:
diff --git a/vertica_python/vertica/messages/backend_messages/empty_query_response.py b/vertica_python/vertica/messages/backend_messages/empty_query_response.py
index fbe68aa..3ba6a7d 100644
--- a/vertica_python/vertica/messages/backend_messages/empty_query_response.py
+++ b/vertica_python/vertica/messages/backend_messages/empty_query_response.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/backend_messages/error_response.py b/vertica_python/vertica/messages/backend_messages/error_response.py
index 471c16e..5ad1065 100644
--- a/vertica_python/vertica/messages/backend_messages/error_response.py
+++ b/vertica_python/vertica/messages/backend_messages/error_response.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 from vertica_python.vertica.messages.backend_messages.notice_response import NoticeResponse
diff --git a/vertica_python/vertica/messages/backend_messages/no_data.py b/vertica_python/vertica/messages/backend_messages/no_data.py
index b9c3c7c..cb4030d 100644
--- a/vertica_python/vertica/messages/backend_messages/no_data.py
+++ b/vertica_python/vertica/messages/backend_messages/no_data.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/backend_messages/notice_response.py b/vertica_python/vertica/messages/backend_messages/notice_response.py
index e0dc35c..4916fef 100644
--- a/vertica_python/vertica/messages/backend_messages/notice_response.py
+++ b/vertica_python/vertica/messages/backend_messages/notice_response.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import string
 
diff --git a/vertica_python/vertica/messages/backend_messages/parameter_description.py b/vertica_python/vertica/messages/backend_messages/parameter_description.py
index 0c0b9fb..d5ddac9 100644
--- a/vertica_python/vertica/messages/backend_messages/parameter_description.py
+++ b/vertica_python/vertica/messages/backend_messages/parameter_description.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import unpack, unpack_from
 
diff --git a/vertica_python/vertica/messages/backend_messages/parameter_status.py b/vertica_python/vertica/messages/backend_messages/parameter_status.py
index 06c952a..7c32b24 100644
--- a/vertica_python/vertica/messages/backend_messages/parameter_status.py
+++ b/vertica_python/vertica/messages/backend_messages/parameter_status.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import string
 
diff --git a/vertica_python/vertica/messages/backend_messages/parse_complete.py b/vertica_python/vertica/messages/backend_messages/parse_complete.py
index ea3c1ab..d286714 100644
--- a/vertica_python/vertica/messages/backend_messages/parse_complete.py
+++ b/vertica_python/vertica/messages/backend_messages/parse_complete.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/backend_messages/portal_suspended.py b/vertica_python/vertica/messages/backend_messages/portal_suspended.py
index 773f078..3b94325 100644
--- a/vertica_python/vertica/messages/backend_messages/portal_suspended.py
+++ b/vertica_python/vertica/messages/backend_messages/portal_suspended.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/backend_messages/ready_for_query.py b/vertica_python/vertica/messages/backend_messages/ready_for_query.py
index 1c38a5a..c6640e7 100644
--- a/vertica_python/vertica/messages/backend_messages/ready_for_query.py
+++ b/vertica_python/vertica/messages/backend_messages/ready_for_query.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import unpack
 
diff --git a/vertica_python/vertica/messages/backend_messages/row_description.py b/vertica_python/vertica/messages/backend_messages/row_description.py
index 1913f32..0e621cf 100644
--- a/vertica_python/vertica/messages/backend_messages/row_description.py
+++ b/vertica_python/vertica/messages/backend_messages/row_description.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import string
 
@@ -15,7 +15,7 @@ class RowDescription(BackendMessage):
         field_count = unpack('!H', data[0:2])[0]
         pos = 2
 
-        for i in xrange(field_count):
+        for i in range(field_count):
             field_info = unpack_from("!{0}sxIHIHIH".format(string.find(data, '\x00', pos) - pos), data, pos)
             self.fields.append({
                 'name': field_info[0],
diff --git a/vertica_python/vertica/messages/backend_messages/unknown.py b/vertica_python/vertica/messages/backend_messages/unknown.py
index e646e89..9333801 100644
--- a/vertica_python/vertica/messages/backend_messages/unknown.py
+++ b/vertica_python/vertica/messages/backend_messages/unknown.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import BackendMessage
 
diff --git a/vertica_python/vertica/messages/frontend_messages/bind.py b/vertica_python/vertica/messages/frontend_messages/bind.py
index bc4bb23..0a1644d 100644
--- a/vertica_python/vertica/messages/frontend_messages/bind.py
+++ b/vertica_python/vertica/messages/frontend_messages/bind.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
@@ -14,7 +14,7 @@ class Bind(FrontendMessage):
 
     def to_bytes(self):
         bytes = pack('!{0}sx{1}sxHH'.format(len(self.portal_name), len(self.prepared_statement_name)), self.portal_name, self.prepared_statement_name, 0, len(self.parameter_values))
-        for val in self.parameter_values.values():
+        for val in list(self.parameter_values.values()):
             if val is None:
                 bytes += pack('!I', [-1])
             else:
diff --git a/vertica_python/vertica/messages/frontend_messages/cancel_request.py b/vertica_python/vertica/messages/frontend_messages/cancel_request.py
index 6e38ef0..b009760 100644
--- a/vertica_python/vertica/messages/frontend_messages/cancel_request.py
+++ b/vertica_python/vertica/messages/frontend_messages/cancel_request.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/close.py b/vertica_python/vertica/messages/frontend_messages/close.py
index 30f8bc3..e18ce0b 100644
--- a/vertica_python/vertica/messages/frontend_messages/close.py
+++ b/vertica_python/vertica/messages/frontend_messages/close.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/copy_data.py b/vertica_python/vertica/messages/frontend_messages/copy_data.py
index 0d30748..23016c8 100644
--- a/vertica_python/vertica/messages/frontend_messages/copy_data.py
+++ b/vertica_python/vertica/messages/frontend_messages/copy_data.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/copy_done.py b/vertica_python/vertica/messages/frontend_messages/copy_done.py
index 6e0697f..9d81088 100644
--- a/vertica_python/vertica/messages/frontend_messages/copy_done.py
+++ b/vertica_python/vertica/messages/frontend_messages/copy_done.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import FrontendMessage
 
diff --git a/vertica_python/vertica/messages/frontend_messages/copy_fail.py b/vertica_python/vertica/messages/frontend_messages/copy_fail.py
index 436ba9c..1458b50 100644
--- a/vertica_python/vertica/messages/frontend_messages/copy_fail.py
+++ b/vertica_python/vertica/messages/frontend_messages/copy_fail.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/copy_stream.py b/vertica_python/vertica/messages/frontend_messages/copy_stream.py
index 29bdc15..97af9ca 100644
--- a/vertica_python/vertica/messages/frontend_messages/copy_stream.py
+++ b/vertica_python/vertica/messages/frontend_messages/copy_stream.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/describe.py b/vertica_python/vertica/messages/frontend_messages/describe.py
index 49e3630..c07f9a0 100644
--- a/vertica_python/vertica/messages/frontend_messages/describe.py
+++ b/vertica_python/vertica/messages/frontend_messages/describe.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/execute.py b/vertica_python/vertica/messages/frontend_messages/execute.py
index df52f25..ad2d250 100644
--- a/vertica_python/vertica/messages/frontend_messages/execute.py
+++ b/vertica_python/vertica/messages/frontend_messages/execute.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/flush.py b/vertica_python/vertica/messages/frontend_messages/flush.py
index 64f06e1..a124e99 100644
--- a/vertica_python/vertica/messages/frontend_messages/flush.py
+++ b/vertica_python/vertica/messages/frontend_messages/flush.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import FrontendMessage
 
diff --git a/vertica_python/vertica/messages/frontend_messages/parse.py b/vertica_python/vertica/messages/frontend_messages/parse.py
index 93056c9..bd7d120 100644
--- a/vertica_python/vertica/messages/frontend_messages/parse.py
+++ b/vertica_python/vertica/messages/frontend_messages/parse.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/password.py b/vertica_python/vertica/messages/frontend_messages/password.py
index b14c390..e6b7e37 100644
--- a/vertica_python/vertica/messages/frontend_messages/password.py
+++ b/vertica_python/vertica/messages/frontend_messages/password.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import os
 
diff --git a/vertica_python/vertica/messages/frontend_messages/query.py b/vertica_python/vertica/messages/frontend_messages/query.py
index 5ca8f3d..5b18784 100644
--- a/vertica_python/vertica/messages/frontend_messages/query.py
+++ b/vertica_python/vertica/messages/frontend_messages/query.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
@@ -13,7 +13,7 @@ class Query(FrontendMessage):
     def to_bytes(self):
         s = self.query_string
         if isinstance(s, str):
-                s = unicode(s, 'utf-8')
+                s = str(s, 'utf-8')
         encoded = s.encode('utf-8')
         return self.message_string(pack('{0}sx'.format(len(encoded)), encoded))
 
diff --git a/vertica_python/vertica/messages/frontend_messages/ssl_request.py b/vertica_python/vertica/messages/frontend_messages/ssl_request.py
index f324074..a26e285 100644
--- a/vertica_python/vertica/messages/frontend_messages/ssl_request.py
+++ b/vertica_python/vertica/messages/frontend_messages/ssl_request.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/startup.py b/vertica_python/vertica/messages/frontend_messages/startup.py
index d796107..89d53e5 100644
--- a/vertica_python/vertica/messages/frontend_messages/startup.py
+++ b/vertica_python/vertica/messages/frontend_messages/startup.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from struct import pack
 
diff --git a/vertica_python/vertica/messages/frontend_messages/sync.py b/vertica_python/vertica/messages/frontend_messages/sync.py
index 1e3ab36..70d70b9 100644
--- a/vertica_python/vertica/messages/frontend_messages/sync.py
+++ b/vertica_python/vertica/messages/frontend_messages/sync.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import FrontendMessage
 
diff --git a/vertica_python/vertica/messages/frontend_messages/terminate.py b/vertica_python/vertica/messages/frontend_messages/terminate.py
index 08b6184..6cdba51 100644
--- a/vertica_python/vertica/messages/frontend_messages/terminate.py
+++ b/vertica_python/vertica/messages/frontend_messages/terminate.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 from vertica_python.vertica.messages.message import FrontendMessage
 
diff --git a/vertica_python/vertica/messages/message.py b/vertica_python/vertica/messages/message.py
index 16d5b01..e32e9e4 100644
--- a/vertica_python/vertica/messages/message.py
+++ b/vertica_python/vertica/messages/message.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+
 
 import types
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-vertica.git



More information about the Python-modules-commits mailing list