diff --git a/tests/relocatable-install.py b/tests/relocatable-install.py
index 04897a36881bdee858d61d283fddde5340126d75..2829b243da38dfd85112920ad89c7d9df8b60345 100755
--- a/tests/relocatable-install.py
+++ b/tests/relocatable-install.py
@@ -122,8 +122,10 @@ def check_dependencies(test, relocatable_install, path, is_wrapper=False):
         stdout=subprocess.PIPE,
         universal_newlines=True,
     )
+    stdout = subproc.stdout
+    assert stdout is not None       # for mypy
 
-    for line in subproc.stdout:
+    for line in stdout:
         line = line.strip()
 
         if (