diff --git a/tes/apiendpoints.py b/tes/apiendpoints.py
index bb28b1f823c50ca88b9804d7e02375e499cf3442..cb60d7dbc53b0b99458d8168fe317df262d8054f 100644
--- a/tes/apiendpoints.py
+++ b/tes/apiendpoints.py
@@ -231,7 +231,7 @@ def wrap_execute(sess, host, user, cmd, bastion=None,stdin=None, sshport="22", b
     except SshExecException as e:
         return apiabort(400, message="{}".format(e))
     # Any other exceptions. This should never be reached.
-    except subprocess.TimedoutExpired as e:
+    except subprocess.TimeoutExpired as e:
         return apiabort(504, message="{}".format(e))
     except Exception as e:
         import traceback