Only use importlib_resources for Python < 3.9. Fixes #2147

This commit is contained in:
grossmj 2022-12-30 09:15:40 +08:00
parent 076e85ddb3
commit c56a8ef8f7
4 changed files with 18 additions and 4 deletions

View File

@ -22,7 +22,11 @@ import uuid
import socket
import shutil
import aiohttp
import importlib_resources
try:
import importlib_resources
except ImportError:
from importlib import resources as importlib_resources
from ..config import Config
from .project import Project

View File

@ -21,9 +21,14 @@ import json
import uuid
import asyncio
import aiohttp
import importlib_resources
import shutil
try:
import importlib_resources
except ImportError:
from importlib import resources as importlib_resources
from .appliance import Appliance
from ..config import Config
from ..utils.asyncio import locking

View File

@ -19,7 +19,12 @@ import atexit
import logging
import os
import sys
import importlib_resources
try:
import importlib_resources
except ImportError:
from importlib import resources as importlib_resources
from contextlib import ExitStack
resource_manager = ExitStack()

View File

@ -11,6 +11,6 @@ psutil==5.9.4
async-timeout>=4.0.2,<4.1
distro>=1.7.0
py-cpuinfo>=9.0.0,<10.0
importlib-resources>=1.3
importlib-resources>=1.3; python_version < '3.9'
setuptools>=60.8.1; python_version >= '3.7'
setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6