[PATCH BlueZ] test: Fix misuse of flags in re.sub() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 4th argument of re.sub() is maximum number of substitutions,
not flags.

The string doesn't contain any newlines, only hex digits, so the
re.DOTALL flag wouldn't have any effect. Let's remove it.
---
 test/sap_client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/sap_client.py b/test/sap_client.py
index 413424c05..ba4f6f544 100644
--- a/test/sap_client.py
+++ b/test/sap_client.py
@@ -311,7 +311,7 @@ class SAPMessage:
 
     def getContent(self):
         s = "%s(id=0x%.2X) " % (self.name,  self.id)
-        if len( self.buf): s = s + "[%s]" % re.sub("(.{2})", "0x\\1 " , self.buf.tostring().encode("hex").upper(), re.DOTALL)
+        if len( self.buf): s = s + "[%s]" % re.sub("(.{2})", "0x\\1 " , self.buf.tostring().encode("hex").upper())
         s = s + "\n\t"
         for p in self.params:
             s = s + "\t" + p.getContent()
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux