diff --git a/cmake_targets/autotests/v2/connection.py b/cmake_targets/autotests/v2/connection.py
index 1952b8b72f713ff2eb7cff44802b6b18fc138f63..3a254f89b8b0fe02dbbd43fecddbad5ea17ee087 100644
--- a/cmake_targets/autotests/v2/connection.py
+++ b/cmake_targets/autotests/v2/connection.py
@@ -13,7 +13,7 @@ class connection:
         try:
             (pid, fd) = os.forkpty()
         except BaseException, e:
-            log("ERROR: forkpty for '" + description + "': " + e)
+            log("ERROR: forkpty for '" + description + "': " + str(e))
             (pid, fd) = (-1, -1)
 
         if pid == -1:
@@ -26,7 +26,7 @@ class connection:
                 os.execvp('sshpass', ['sshpass', '-p', password,
                           'ssh', user + '@' + host])
             except BaseException, e:
-                log("ERROR: execvp for '" + description + "': " + e)
+                log("ERROR: execvp for '" + description + "': " + str(e))
             log("ERROR: execvp failed for '" + description + "'")
             os._exit(1)