@@ -25,7 +25,12 @@
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'
@@ -27,11 +27,14 @@
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: