summary refs log tree commit diff stats
path: root/tests/qemu-iotests/testenv.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/testenv.py')
-rw-r--r--tests/qemu-iotests/testenv.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index 588f30a4f1..96d69e5696 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -25,7 +25,12 @@ import collections
 import random
 import subprocess
 import glob
-from typing import List, Dict, Any, Optional, ContextManager
+from typing import List, Dict, Any, Optional
+
+if sys.version_info >= (3, 9):
+    from contextlib import AbstractContextManager as ContextManager
+else:
+    from typing import ContextManager
 
 DEF_GDB_OPTIONS = 'localhost:12345'