You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2023/04/10 22:16:13 UTC

[qpid-python] 05/05: QPID-8631: remove extraneous semicolons

This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-python.git

commit 86bea7c3a9a97cbf71ed7bf5a39a8d53a3015bfb
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Sat Apr 8 18:33:45 2023 +0200

    QPID-8631: remove extraneous semicolons
---
 examples/api/hello                   |  2 +-
 qpid-python-test                     |  6 +++---
 qpid/client.py                       |  2 +-
 qpid/codec.py                        |  2 +-
 qpid/connection08.py                 |  3 ++-
 qpid/delegates.py                    |  2 +-
 qpid/management.py                   |  4 ++--
 qpid/managementdata.py               |  4 ++--
 qpid/messaging/driver.py             |  2 +-
 qpid/peer.py                         | 14 ++++++------
 qpid/selector.py                     |  2 +-
 qpid/tests/messaging/__init__.py     |  2 +-
 qpid/tests/messaging/endpoints.py    |  2 +-
 qpid_tests/broker_0_10/exchange.py   | 10 ++++-----
 qpid_tests/broker_0_10/message.py    |  2 +-
 qpid_tests/broker_0_10/msg_groups.py | 42 ++++++++++++++++++------------------
 qpid_tests/broker_0_10/new_api.py    | 16 +++++++-------
 qpid_tests/broker_0_10/queue.py      |  2 +-
 qpid_tests/broker_0_8/basic.py       |  2 +-
 qpid_tests/broker_0_8/exchange.py    |  4 ++--
 qpid_tests/broker_0_8/queue.py       |  2 +-
 qpid_tests/broker_0_8/testlib.py     |  4 ++--
 22 files changed, 66 insertions(+), 65 deletions(-)

diff --git a/examples/api/hello b/examples/api/hello
index dffff88..ac2311e 100755
--- a/examples/api/hello
+++ b/examples/api/hello
@@ -41,7 +41,7 @@ try:
   sender = session.sender(address)
   receiver = session.receiver(address)
 
-  sender.send(Message("Hello world!"));
+  sender.send(Message("Hello world!"))
 
   message = receiver.fetch()
   print(message.content)
diff --git a/qpid-python-test b/qpid-python-test
index 791f38b..ac7d70b 100755
--- a/qpid-python-test
+++ b/qpid-python-test
@@ -201,7 +201,7 @@ def indent(text):
 class JunitXmlStyleReporter:
 
   def __init__(self, file):
-    self.f = open(file, "w");
+    self.f = open(file, "w")
 
   def begin(self):
     self.f.write('<?xml version="1.0" encoding="UTF-8" ?>\n')
@@ -575,8 +575,8 @@ ignored = [t for t in h.tests if is_ignored(t.name())]
 total = len(filtered) + len(ignored)
 
 if opts.xml and not list_only:
-   xmlr = JunitXmlStyleReporter(opts.xml);
-   xmlr.begin();
+   xmlr = JunitXmlStyleReporter(opts.xml)
+   xmlr.begin()
 else:
    xmlr = None
 
diff --git a/qpid/client.py b/qpid/client.py
index b062ea5..305f6b3 100644
--- a/qpid/client.py
+++ b/qpid/client.py
@@ -137,7 +137,7 @@ class Client:
     if self.peer:
       try:
         if not self.closed:
-          channel = self.channel(0);
+          channel = self.channel(0)
           if channel and not channel._closed:
              try:
                channel.connection_close(reply_code=200)
diff --git a/qpid/codec.py b/qpid/codec.py
index 4297704..a300dc5 100644
--- a/qpid/codec.py
+++ b/qpid/codec.py
@@ -536,7 +536,7 @@ class Codec:
     set = []
     for i in range(0, count):
       set.append(self.decode_long())
-    return set;
+    return set
 
   def encode_uuid(self, s):
     self.pack("16s", s)
diff --git a/qpid/connection08.py b/qpid/connection08.py
index 527e9b6..4272c01 100644
--- a/qpid/connection08.py
+++ b/qpid/connection08.py
@@ -305,7 +305,8 @@ class Connection:
     return self.read_0_10()
 
   def close(self):
-    self.io.close();
+    self.io.close()
+
 
 class Frame:
 
diff --git a/qpid/delegates.py b/qpid/delegates.py
index 8071296..482f59f 100644
--- a/qpid/delegates.py
+++ b/qpid/delegates.py
@@ -90,7 +90,7 @@ class Delegate:
     self.connection.detach(d.name, ch)
 
   def session_request_timeout(self, ch, rt):
-    ch.session_timeout(rt.timeout);
+    ch.session_timeout(rt.timeout)
 
   def session_command_point(self, ch, cp):
     ssn = ch.session
diff --git a/qpid/management.py b/qpid/management.py
index 7d5e39a..1f11535 100644
--- a/qpid/management.py
+++ b/qpid/management.py
@@ -656,7 +656,7 @@ class managementClient:
     name        = codec.read_str8()
     classKey    = (packageName, className, hash)
     if classKey not in self.schema:
-      return;
+      return
     schemaClass = self.schema[classKey]
     row = []
     es = schemaClass['E']
@@ -880,7 +880,7 @@ class managementClient:
     elif opcode == 'g':
       self.parseContent (ch, 'B', codec, seq)
     else:
-      raise ValueError ("Unknown opcode: %c" % opcode);
+      raise ValueError ("Unknown opcode: %c" % opcode)
 
   def method (self, channel, userSequence, objId, classId, methodName, args):
     """ Invoke a method on an object """
diff --git a/qpid/managementdata.py b/qpid/managementdata.py
index b6338ee..514dd6f 100644
--- a/qpid/managementdata.py
+++ b/qpid/managementdata.py
@@ -162,10 +162,10 @@ class ManagementData:
       pass
 
   def configHandler (self, context, className, list, timestamps):
-    self.dataHandler (0, className, list, timestamps);
+    self.dataHandler (0, className, list, timestamps)
 
   def instHandler (self, context, className, list, timestamps):
-    self.dataHandler (1, className, list, timestamps);
+    self.dataHandler (1, className, list, timestamps)
 
   def methodReply (self, broker, sequence, status, sText, args):
     """ Callback for method-reply messages """
diff --git a/qpid/messaging/driver.py b/qpid/messaging/driver.py
index 1106635..cb6c931 100644
--- a/qpid/messaging/driver.py
+++ b/qpid/messaging/driver.py
@@ -767,7 +767,7 @@ class Engine:
         _text=str(e)
       raise AuthenticationFailure(text=_text)
 
-    client_properties = get_client_properties_with_defaults(provided_client_properties=self.connection.client_properties);
+    client_properties = get_client_properties_with_defaults(provided_client_properties=self.connection.client_properties)
     self.write_op(ConnectionStartOk(client_properties=client_properties,
                                     mechanism=mech, response=initial))
 
diff --git a/qpid/peer.py b/qpid/peer.py
index 6386584..290ff3f 100644
--- a/qpid/peer.py
+++ b/qpid/peer.py
@@ -161,18 +161,18 @@ class Peer:
 
   def stop(self):
     try:
-      self.work.close();
-      self.outgoing.close();
-      self.conn.close();
+      self.work.close()
+      self.outgoing.close()
+      self.conn.close()
     finally:
-      timeout = 1;
-      self.worker_thread.join(timeout);
+      timeout = 1
+      self.worker_thread.join(timeout)
       if self.worker_thread.is_alive():
         log.warn("Worker thread failed to shutdown within timeout")
-      self.reader_thread.join(timeout);
+      self.reader_thread.join(timeout)
       if self.reader_thread.is_alive():
         log.warn("Reader thread failed to shutdown within timeout")
-      self.writer_thread.join(timeout);
+      self.writer_thread.join(timeout)
       if self.writer_thread.is_alive():
         log.warn("Writer thread failed to shutdown within timeout")
 
diff --git a/qpid/selector.py b/qpid/selector.py
index d26829d..ef7b441 100644
--- a/qpid/selector.py
+++ b/qpid/selector.py
@@ -126,7 +126,7 @@ class Selector:
     _check(self.exception)
     self.thread = Thread(target=self.run)
     self.thread.daemon = True
-    self.thread.start();
+    self.thread.start()
 
   def run(self):
     try:
diff --git a/qpid/tests/messaging/__init__.py b/qpid/tests/messaging/__init__.py
index 29d9bab..1753eec 100644
--- a/qpid/tests/messaging/__init__.py
+++ b/qpid/tests/messaging/__init__.py
@@ -201,7 +201,7 @@ class VersionTest (Base):
   def create_connection(self, version="amqp1.0", force=False):
     opts = self.connection_options()
     if force or not 'protocol' in opts:
-      opts['protocol'] = version;
+      opts['protocol'] = version
     return Connection.establish(self.broker, **opts)
 
   def setup_connection(self):
diff --git a/qpid/tests/messaging/endpoints.py b/qpid/tests/messaging/endpoints.py
index 1320ac2..a5c6d17 100644
--- a/qpid/tests/messaging/endpoints.py
+++ b/qpid/tests/messaging/endpoints.py
@@ -681,7 +681,7 @@ class SessionTests(Base):
     deadline = time.time() + self.timeout()
     while time.time() < deadline:
         if cb.handler_called:
-            break;
+            break
     assert cb.handler_called
     assert cb.ssn == self.ssn
     snd.close()
diff --git a/qpid_tests/broker_0_10/exchange.py b/qpid_tests/broker_0_10/exchange.py
index 0cd0a55..83c71f4 100644
--- a/qpid_tests/broker_0_10/exchange.py
+++ b/qpid_tests/broker_0_10/exchange.py
@@ -185,7 +185,7 @@ class StandardExchangeVerifier:
             headers = {"name":"fred", "age":3}
             self.assertPublishGet(q, exchange=ex, properties=headers)
             self.session.message_transfer(destination=ex) # No headers, won't deliver
-            self.assertEmpty(q);
+            self.assertEmpty(q)
         finally:
             if unbind:
                 self.session.exchange_unbind(queue="q", exchange=ex, binding_key="")
@@ -546,19 +546,19 @@ class AutodeleteTests(TestHelper, StandardExchangeVerifier):
     def testAutodeleteFanout(self):
         self.session.exchange_declare(exchange="e", type="fanout", auto_delete=True)
         self.verifyFanOutExchange("e", unbind=True)
-        self.checkNotExists("e");
+        self.checkNotExists("e")
 
     def testAutodeleteDirect(self):
         self.session.exchange_declare(exchange="e", type="direct", auto_delete=True)
         self.verifyDirectExchange("e", unbind=True)
-        self.checkNotExists("e");
+        self.checkNotExists("e")
 
     def testAutodeleteTopic(self):
         self.session.exchange_declare(exchange="e", type="topic", auto_delete=True)
         self.verifyTopicExchange("e", unbind=True)
-        self.checkNotExists("e");
+        self.checkNotExists("e")
 
     def testAutodeleteHeaders(self):
         self.session.exchange_declare(exchange="e", type="headers", auto_delete=True)
         self.verifyHeadersExchange("e", unbind=True)
-        self.checkNotExists("e");
+        self.checkNotExists("e")
diff --git a/qpid_tests/broker_0_10/message.py b/qpid_tests/broker_0_10/message.py
index 9b9a051..76813e4 100644
--- a/qpid_tests/broker_0_10/message.py
+++ b/qpid_tests/broker_0_10/message.py
@@ -1028,7 +1028,7 @@ class MessageTests(TestBase010):
         session.message_flow(unit = session.credit_unit.message, value = 10, destination = "a")
 
         # receive all messages into list
-        messages = [];
+        messages = []
         for i in range(1, 11):
             msg = a.get(timeout = 1)
             self.assertEquals("message-%d" % (i), msg.body)
diff --git a/qpid_tests/broker_0_10/msg_groups.py b/qpid_tests/broker_0_10/msg_groups.py
index 124625a..ca229e6 100644
--- a/qpid_tests/broker_0_10/msg_groups.py
+++ b/qpid_tests/broker_0_10/msg_groups.py
@@ -71,24 +71,24 @@ class MultiConsumerMsgGroupTests(Base):
 
         # C1 should acquire A-0, then C2 should acquire B-3
 
-        m1 = c1.fetch(0);
+        m1 = c1.fetch(0)
         assert m1.properties['THE-GROUP'] == 'A'
         assert m1.content['index'] == 0
 
-        m2 = c2.fetch(0);
+        m2 = c2.fetch(0)
         assert m2.properties['THE-GROUP'] == 'B'
         assert m2.content['index'] == 3
 
         # C1 Acknowledge A-0
-        c1.session.acknowledge(m1);
+        c1.session.acknowledge(m1)
 
         # C2 should next acquire A-1
-        m3 = c2.fetch(0);
+        m3 = c2.fetch(0)
         assert m3.properties['THE-GROUP'] == 'A'
         assert m3.content['index'] == 1
 
         # C1 should next acquire C-6, since groups A&B are held by c2
-        m4 = c1.fetch(0);
+        m4 = c1.fetch(0)
         assert m4.properties['THE-GROUP'] == 'C'
         assert m4.content['index'] == 6
 
@@ -96,13 +96,13 @@ class MultiConsumerMsgGroupTests(Base):
         ## Owners= ---, ^C2, +C2, ^C2, +C2, +C2, ^C1, +C1, +C1,
 
         # C2 Acknowledge B-3, freeing up the rest of B group
-        c2.session.acknowledge(m2);
+        c2.session.acknowledge(m2)
 
         ## Queue = XXX, a-1, a-2, XXX, b-4, b-5, c-6, c-7, c-8...
         ## Owners= ---, ^C2, +C2, ---, ---, ---, ^C1, +C1, +C1,
 
         # C1 should now acquire B-4, since it is next "free"
-        m5 = c1.fetch(0);
+        m5 = c1.fetch(0)
         assert m5.properties['THE-GROUP'] == 'B'
         assert m5.content['index'] == 4
 
@@ -116,11 +116,11 @@ class MultiConsumerMsgGroupTests(Base):
         ## Owners= ---, ^C2, +C2, ---, ^C1, +C1, ---, ---, ---
 
         # C2 should next fetch A-2, followed by C-7
-        m7 = c2.fetch(0);
+        m7 = c2.fetch(0)
         assert m7.properties['THE-GROUP'] == 'A'
         assert m7.content['index'] == 2
 
-        m8 = c2.fetch(0);
+        m8 = c2.fetch(0)
         assert m8.properties['THE-GROUP'] == 'C'
         assert m8.content['index'] == 7
 
@@ -134,7 +134,7 @@ class MultiConsumerMsgGroupTests(Base):
         ## Owners= ---, ---, ---, ---, ^C1, +C1, ---, ---, ---
 
         # the next fetch of C2 would get C-8, since B-5 is "owned"
-        m9 = c2.fetch(0);
+        m9 = c2.fetch(0)
         assert m9.properties['THE-GROUP'] == 'C'
         assert m9.content['index'] == 8
 
@@ -148,7 +148,7 @@ class MultiConsumerMsgGroupTests(Base):
         ## Owners= ---, ---, ---, ---, ---, ^C2, ---, ---, ^C2
 
         # the next fetch of C2 would get B-5
-        m10 = c2.fetch(0);
+        m10 = c2.fetch(0)
         assert m10.properties['THE-GROUP'] == 'B'
         assert m10.content['index'] == 5
 
@@ -194,13 +194,13 @@ class MultiConsumerMsgGroupTests(Base):
         s2 = self.setup_session()
         b1 = s2.receiver("msg-group-q; {mode: browse}", options={"capacity":0})
 
-        m2 = b1.fetch(0);
+        m2 = b1.fetch(0)
         assert m2.properties['THE-GROUP'] == 'A'
         assert m2.content['index'] == 0
 
         # C1 should acquire A-0
 
-        m1 = c1.fetch(0);
+        m1 = c1.fetch(0)
         assert m1.properties['THE-GROUP'] == 'A'
         assert m1.content['index'] == 0
 
@@ -222,7 +222,7 @@ class MultiConsumerMsgGroupTests(Base):
         assert m2.content['index'] == 3
 
         # verify the consumer can own groups currently seen by the browser
-        m3 = c1.fetch(0);
+        m3 = c1.fetch(0)
         assert m3.properties['THE-GROUP'] == 'B'
         assert m3.content['index'] == 1
 
@@ -337,7 +337,7 @@ class MultiConsumerMsgGroupTests(Base):
         assert m2.content['index'] == 2
 
         # C1 shuffles off the mortal coil...
-        c1.close();
+        c1.close()
 
         # but the session (s1) remains active, so "A" remains blocked
         # from c2, c2 should fetch the next B-3
@@ -1024,7 +1024,7 @@ class MultiConsumerMsgGroupTests(Base):
         c2 = s2.receiver("msg-group-q", options={"capacity":0})
 
         # C1 should acquire A-0
-        m1 = c1.fetch(0);
+        m1 = c1.fetch(0)
         assert m1.properties['THE-GROUP'] == 'A'
         assert m1.content['index'] == 0
 
@@ -1138,7 +1138,7 @@ class MultiConsumerMsgGroupTests(Base):
             m.content['index'] = index
             index += 1
             if m.properties['THE-GROUP'] == 'B':
-                m.ttl = 1;
+                m.ttl = 1
             snd.send(m)
 
         sleep(2)  # let all B's expire
@@ -1152,19 +1152,19 @@ class MultiConsumerMsgGroupTests(Base):
         # C1 should acquire A-0, then C2 should acquire C-2, Group B should
         # expire and never be fetched
 
-        m1 = c1.fetch(0);
+        m1 = c1.fetch(0)
         assert m1.properties['THE-GROUP'] == 'A'
         assert m1.content['index'] == 0
 
-        m2 = c2.fetch(0);
+        m2 = c2.fetch(0)
         assert m2.properties['THE-GROUP'] == 'C'
         assert m2.content['index'] == 2
 
-        m1 = c1.fetch(0);
+        m1 = c1.fetch(0)
         assert m1.properties['THE-GROUP'] == 'A'
         assert m1.content['index'] == 3
 
-        m2 = c2.fetch(0);
+        m2 = c2.fetch(0)
         assert m2.properties['THE-GROUP'] == 'C'
         assert m2.content['index'] == 5
 
diff --git a/qpid_tests/broker_0_10/new_api.py b/qpid_tests/broker_0_10/new_api.py
index 301b0ad..48a4691 100644
--- a/qpid_tests/broker_0_10/new_api.py
+++ b/qpid_tests/broker_0_10/new_api.py
@@ -156,12 +156,12 @@ class GeneralTests(Base):
         conn2 = Connection.establish(self.broker, **self.connection_options())
         ssn2 = conn2.session()
 
-        s1 = self.ssn.sender("holding_q; {create:always, delete:always, node:{x-declare:{alternate-exchange:'amq.fanout'}}}");
-        s2 = ssn2.sender("holding_q");
+        s1 = self.ssn.sender("holding_q; {create:always, delete:always, node:{x-declare:{alternate-exchange:'amq.fanout'}}}")
+        s2 = ssn2.sender("holding_q")
 
-        s2.send(Message("a"));
-        s1.send(Message("b"));
-        s2.send(Message("c"));
+        s2.send(Message("a"))
+        s1.send(Message("b"))
+        s2.send(Message("c"))
 
         r = self.ssn.receiver("amq.fanout; {link:{x-declare:{arguments:{'no-local':True}}}}")
 
@@ -181,15 +181,15 @@ class GeneralTests(Base):
         self.assertEqual(received, ["a", "c"])
 
     def _node_disambiguation_test(self, e, q, ambiguous_send=False):
-        s1 = self.ssn.sender("ambiguous; {node:{type:topic}}");
-        s2 = self.ssn.sender("ambiguous; {node:{type:queue}}");
+        s1 = self.ssn.sender("ambiguous; {node:{type:topic}}")
+        s2 = self.ssn.sender("ambiguous; {node:{type:queue}}")
         s1.send(Message("a"))
         s2.send(Message("b"))
         if ambiguous_send:
             # pure python client defaults to using the queue when the
             # node name is ambiguous and no type is specified; the
             # swigged version treats this as an error
-            s3 = self.ssn.sender("ambiguous");
+            s3 = self.ssn.sender("ambiguous")
             s3.send(Message("c"))
         self.assertEqual(e.fetch().content, "a")
         self.assertEqual(q.fetch().content, "b")
diff --git a/qpid_tests/broker_0_10/queue.py b/qpid_tests/broker_0_10/queue.py
index a3de6cb..2416afa 100644
--- a/qpid_tests/broker_0_10/queue.py
+++ b/qpid_tests/broker_0_10/queue.py
@@ -43,7 +43,7 @@ class QueueTests(TestBase010):
         self.assertEqual(3, reply.message_count)
 
         #now do the purge, then test that three messages are purged and the count drops to 0
-        session.queue_purge(queue="test-queue");
+        session.queue_purge(queue="test-queue")
         reply = session.queue_query(queue="test-queue")
         self.assertEqual(0, reply.message_count)        
 
diff --git a/qpid_tests/broker_0_8/basic.py b/qpid_tests/broker_0_8/basic.py
index 4638a9f..286acb0 100644
--- a/qpid_tests/broker_0_8/basic.py
+++ b/qpid_tests/broker_0_8/basic.py
@@ -375,7 +375,7 @@ class BasicTests(TestBase):
 
         #make sure that a single oversized message still gets delivered
         large = "abcdefghijklmnopqrstuvwxyz"
-        large = large + "-" + large;
+        large = large + "-" + large
         channel.basic_publish(routing_key="test-prefetch-size", content=Content(large))
         msg = queue.get(timeout=self.recv_timeout())
         self.assertEqual(large, msg.content.body)
diff --git a/qpid_tests/broker_0_8/exchange.py b/qpid_tests/broker_0_8/exchange.py
index bd496b0..3a24784 100644
--- a/qpid_tests/broker_0_8/exchange.py
+++ b/qpid_tests/broker_0_8/exchange.py
@@ -80,8 +80,8 @@ class StandardExchangeVerifier:
         headers = {"name":"fred", "age":3}
         self.assertPublishGet(q, exchange=ex, properties={'headers':headers})
         self.channel.basic_publish(exchange=ex) # No headers, won't deliver
-        self.assertEmpty(q);                 
-        
+        self.assertEmpty(q)
+
 
 class RecommendedTypesRuleTests(TestBase, StandardExchangeVerifier):
     """
diff --git a/qpid_tests/broker_0_8/queue.py b/qpid_tests/broker_0_8/queue.py
index f5e17e2..f755137 100644
--- a/qpid_tests/broker_0_8/queue.py
+++ b/qpid_tests/broker_0_8/queue.py
@@ -43,7 +43,7 @@ class QueueTests(TestBase):
         self.assertEqual(3, reply.message_count)
 
         #now do the purge, then test that three messages are purged and the count drops to 0
-        reply = channel.queue_purge(queue="test-queue");
+        reply = channel.queue_purge(queue="test-queue")
         self.assertEqual(3, reply.message_count)        
         reply = channel.queue_declare(queue="test-queue")
         self.assertEqual(0, reply.message_count)
diff --git a/qpid_tests/broker_0_8/testlib.py b/qpid_tests/broker_0_8/testlib.py
index 592eeaf..02e7ad7 100644
--- a/qpid_tests/broker_0_8/testlib.py
+++ b/qpid_tests/broker_0_8/testlib.py
@@ -34,7 +34,7 @@ import sys
 from traceback import *
 
 def mytrace(frame, event, arg):
-    print_stack(frame);
+    print_stack(frame)
     print("====")
     return mytrace
     
@@ -56,7 +56,7 @@ class TestBaseTest(TestBase):
         q = self.consume("full")
         self.channel.basic_publish(routing_key="full")
         try:
-            self.assertEmpty(q);
+            self.assertEmpty(q)
             self.fail("assertEmpty did not assert on non-empty queue")
         except AssertionError: None     # Ignore
 


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