mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-16 11:00:58 +00:00
Only use importlib_resources for Python < 3.9. Fixes #2147
This commit is contained in:
parent
076e85ddb3
commit
c56a8ef8f7
@ -22,7 +22,11 @@ import uuid
|
|||||||
import socket
|
import socket
|
||||||
import shutil
|
import shutil
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import importlib_resources
|
|
||||||
|
try:
|
||||||
|
import importlib_resources
|
||||||
|
except ImportError:
|
||||||
|
from importlib import resources as importlib_resources
|
||||||
|
|
||||||
from ..config import Config
|
from ..config import Config
|
||||||
from .project import Project
|
from .project import Project
|
||||||
|
@ -21,9 +21,14 @@ import json
|
|||||||
import uuid
|
import uuid
|
||||||
import asyncio
|
import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import importlib_resources
|
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
try:
|
||||||
|
import importlib_resources
|
||||||
|
except ImportError:
|
||||||
|
from importlib import resources as importlib_resources
|
||||||
|
|
||||||
|
|
||||||
from .appliance import Appliance
|
from .appliance import Appliance
|
||||||
from ..config import Config
|
from ..config import Config
|
||||||
from ..utils.asyncio import locking
|
from ..utils.asyncio import locking
|
||||||
|
@ -19,7 +19,12 @@ import atexit
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import importlib_resources
|
|
||||||
|
try:
|
||||||
|
import importlib_resources
|
||||||
|
except ImportError:
|
||||||
|
from importlib import resources as importlib_resources
|
||||||
|
|
||||||
|
|
||||||
from contextlib import ExitStack
|
from contextlib import ExitStack
|
||||||
resource_manager = ExitStack()
|
resource_manager = ExitStack()
|
||||||
|
@ -11,6 +11,6 @@ psutil==5.9.4
|
|||||||
async-timeout>=4.0.2,<4.1
|
async-timeout>=4.0.2,<4.1
|
||||||
distro>=1.7.0
|
distro>=1.7.0
|
||||||
py-cpuinfo>=9.0.0,<10.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>=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
|
setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6
|
||||||
|
Loading…
Reference in New Issue
Block a user