[svn] commit: r327 - /branches/parkinglot/src/lib/cc/python/ISC/CC/session.py

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 1 16:23:52 UTC 2009


Author: jelte
Date: Tue Dec  1 16:23:52 2009
New Revision: 327

Log:
be lenient on the receiving end whether env["msg"] is a str or a bytearray (until we use the new wireformat i guess)

Modified:
    branches/parkinglot/src/lib/cc/python/ISC/CC/session.py

Modified: branches/parkinglot/src/lib/cc/python/ISC/CC/session.py
==============================================================================
--- branches/parkinglot/src/lib/cc/python/ISC/CC/session.py (original)
+++ branches/parkinglot/src/lib/cc/python/ISC/CC/session.py Tue Dec  1 16:23:52 2009
@@ -137,7 +137,10 @@
             # return none twice to match normal return value
             # (so caller won't get a type error on no data)
             return (None, None)
-        msg = Message.from_wire(env["msg"].encode('ascii'))
+        if type(env["msg"]) != bytearray:
+            msg = Message.from_wire(env["msg"].encode('ascii'))
+        else:
+            msg = Message.from_wire(env["msg"])
         return (msg, env)
 
     def group_reply(self, routing, msg):




More information about the bind10-changes mailing list