summary refs log tree commit diff stats
path: root/tests/qemu-iotests/testrunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/testrunner.py')
-rw-r--r--tests/qemu-iotests/testrunner.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index 7b322272e9..2e236c8fa3 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -27,11 +27,14 @@ import json
 import shutil
 import sys
 from multiprocessing import Pool
-from typing import List, Optional, Any, Sequence, Dict, \
-        ContextManager
-
+from typing import List, Optional, Any, Sequence, Dict
 from testenv import TestEnv
 
+if sys.version_info >= (3, 9):
+    from contextlib import AbstractContextManager as ContextManager
+else:
+    from typing import ContextManager
+
 
 def silent_unlink(path: Path) -> None:
     try: