diff --git a/src/zdaemon/tests/testzdrun.py b/src/zdaemon/tests/testzdrun.py
index 943f2931c469834b416004a25dabfc49421ff25f..5485da4fc185dac945b8d88526292512b088529e 100644
--- a/src/zdaemon/tests/testzdrun.py
+++ b/src/zdaemon/tests/testzdrun.py
@@ -281,7 +281,7 @@ def send_action(action, sockname):
         sock.close()
         return response
     except socket.error, msg:
-        if msg[1] == 'AF_UNIX path too long':
+        if str(msg) == 'AF_UNIX path too long':
             # MacOS has apparent small limits on the length of a UNIX
             # domain socket filename, we want to make MacOS users aware
             # of the actual problem