test/py: Correct handling of exceptions

If an Unexpected exception is thrown in a test, an undefined variable
error is reported. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 85d7dae377a ("test: Detect dead connections")
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
diff --git a/test/py/conftest.py b/test/py/conftest.py
index eec0b54..8ce680a 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -515,7 +515,7 @@
     except BootFail as err:
         handle_exception(ubconfig, ubman_fix, log, err, 'Boot fail', True,
                          ubman_fix.get_spawn_output())
-    except Unexpected:
+    except Unexpected as err:
         handle_exception(ubconfig, ubman_fix, log, err, 'Unexpected test output',
                          False)
     return ubman_fix