qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject [2/3] qpid-proton git commit: PROTON-490: run the "futurize" tool on all python source files
Date Wed, 22 Apr 2015 14:45:37 GMT
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/903c7246/tests/python/proton_tests/transport.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/transport.py b/tests/python/proton_tests/transport.py
index febb029..e158a5b 100644
--- a/tests/python/proton_tests/transport.py
+++ b/tests/python/proton_tests/transport.py
@@ -17,7 +17,8 @@
 # under the License.
 #
 
-import os, common
+import os
+from . import common
 from proton import *
 
 
@@ -119,7 +120,8 @@ class TransportTest(Test):
     assert n > 0, n
     try:
       self.transport.close_head()
-    except TransportException, e:
+    except TransportException:
+      e = sys.exc_info()[1]
       assert "aborted" in str(e), str(e)
     n = self.transport.pending()
     assert n < 0, n
@@ -129,7 +131,8 @@ class TransportTest(Test):
     assert n > 0, n
     try:
       self.transport.close_tail()
-    except TransportException, e:
+    except TransportException:
+      e = sys.exc_info()[1]
       assert "aborted" in str(e), str(e)
     n = self.transport.capacity()
     assert n < 0, n

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/903c7246/tests/python/proton_tests/url.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/url.py b/tests/python/proton_tests/url.py
index 77a16ff..40a257c 100644
--- a/tests/python/proton_tests/url.py
+++ b/tests/python/proton_tests/url.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -18,7 +19,7 @@
 #
 
 
-import common
+from . import common
 from proton import Url
 
 class UrlTest(common.Test):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/903c7246/tests/smoke/recv.py
----------------------------------------------------------------------
diff --git a/tests/smoke/recv.py b/tests/smoke/recv.py
index 3b2b0e5..e6aa2b6 100755
--- a/tests/smoke/recv.py
+++ b/tests/smoke/recv.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+from __future__ import print_function
 import sys
 from proton import *
 
@@ -16,7 +17,7 @@ messenger.start()
 while True:
   messenger.recv()
   messenger.get(message)
-  print "Got: %s" % message
+  print("Got: %s" % message)
   messenger.accept()
 
 messenger.stop()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/903c7246/tests/smoke/send.py
----------------------------------------------------------------------
diff --git a/tests/smoke/send.py b/tests/smoke/send.py
index 1aed9c8..7daee01 100755
--- a/tests/smoke/send.py
+++ b/tests/smoke/send.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+from __future__ import print_function
 import sys
 from proton import *
 
@@ -17,7 +18,7 @@ message.body = u"Hello World!"
 
 messenger.start()
 tracker = messenger.put(message)
-print "Put: %s" % message
+print("Put: %s" % message)
 messenger.send()
-print "Status: %s" % messenger.status(tracker)
+print("Status: %s" % messenger.status(tracker))
 messenger.stop()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/903c7246/tests/tools/apps/python/msgr-recv.py
----------------------------------------------------------------------
diff --git a/tests/tools/apps/python/msgr-recv.py b/tests/tools/apps/python/msgr-recv.py
index 73c2a3a..079c871 100755
--- a/tests/tools/apps/python/msgr-recv.py
+++ b/tests/tools/apps/python/msgr-recv.py
@@ -18,6 +18,7 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+from __future__ import print_function
 import sys, optparse, time
 import logging
 from proton import *

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/903c7246/tests/tools/apps/python/msgr-send.py
----------------------------------------------------------------------
diff --git a/tests/tools/apps/python/msgr-send.py b/tests/tools/apps/python/msgr-send.py
index 872122b..a2f67c5 100755
--- a/tests/tools/apps/python/msgr-send.py
+++ b/tests/tools/apps/python/msgr-send.py
@@ -18,6 +18,7 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+from __future__ import print_function
 import sys, optparse, time
 import logging
 from proton import *


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message