diff --git a/IPython/html/tests/launchnotebook.py b/IPython/html/tests/launchnotebook.py
index 3666a0c..c9a5ee8 100644
--- a/IPython/html/tests/launchnotebook.py
+++ b/IPython/html/tests/launchnotebook.py
@@ -16,6 +16,11 @@ from IPython.utils.tempdir import TemporaryDirectory
MAX_WAITTIME = 30 # seconds to wait for notebook server to start
POLL_INTERVAL = 0.1 # time between attempts
+# TimeoutError is a builtin on Python 3. This can be removed when we stop
+# supporting Python 2.
+class TimeoutError(Exception):
+ pass
+
class NotebookTestBase(TestCase):
"""A base class for tests that need a running notebook.