diff options
author | Rafael H. Schloming <rhs@apache.org> | 2009-05-12 21:36:14 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2009-05-12 21:36:14 +0000 |
commit | c39958434384e2833ec2f9e9139010ba28ae02dd (patch) | |
tree | a2550b9e6e5e8a5153404c286b83540af61204bc | |
parent | eae3947ff54bfe2d7a0fa70cea02c4194f50ccf4 (diff) | |
download | qpid-python-c39958434384e2833ec2f9e9139010ba28ae02dd.tar.gz |
updated imports to work on python 2.6
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@774100 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | python/qpid/connection.py | 15 | ||||
-rw-r--r-- | python/qpid/message.py | 1 | ||||
-rw-r--r-- | python/qpid/util.py | 5 |
3 files changed, 14 insertions, 7 deletions
diff --git a/python/qpid/connection.py b/python/qpid/connection.py index d4c5755219..f32bb8b428 100644 --- a/python/qpid/connection.py +++ b/python/qpid/connection.py @@ -17,7 +17,7 @@ # under the License. # -import datatypes, session, socket +import datatypes, session from threading import Thread, Condition, RLock from util import wait, notify from assembler import Assembler, Segment @@ -54,10 +54,15 @@ class SSLWrapper: def send(self, s): return self.ssl.write(s) -def sslwrap(sock): - if isinstance(sock, socket.SSLType): - return SSLWrapper(sock) - else: +try: + from socket import SSLType + def sslwrap(sock): + if isinstance(sock, SSLType): + return SSLWrapper(sock) + else: + return sock +except ImportError: + def sslwrap(sock): return sock class Connection(Assembler): diff --git a/python/qpid/message.py b/python/qpid/message.py index eb3ef5c03c..4d31da2846 100644 --- a/python/qpid/message.py +++ b/python/qpid/message.py @@ -17,7 +17,6 @@ # under the License. # from connection08 import Method, Request -from sets import Set class Message: diff --git a/python/qpid/util.py b/python/qpid/util.py index f4b613f4e5..c1ea2d60d6 100644 --- a/python/qpid/util.py +++ b/python/qpid/util.py @@ -19,7 +19,10 @@ import os, socket, time, textwrap, re -ssl = socket.ssl +try: + from ssl import wrap_socket as ssl +except ImportError: + from socket import ssl def connect(host, port): sock = socket.socket() |