Fix remaining logic to support Python 3.6/7

... because this library no longer supports these old versions and
requires Python >= 3.8 now[1].

[1] 8efaa1ceb8

Change-Id: I2b229b24425d3afb9159b2479bd9547e3443011f
This commit is contained in:
Takashi Kajinami 2022-06-21 21:53:16 +09:00
parent 8efaa1ceb8
commit ccd17543a3
5 changed files with 4 additions and 27 deletions

View File

@ -3,4 +3,3 @@
# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
importlib_metadata>=1.7.0;python_version<'3.8' # Apache-2.0

View File

@ -15,6 +15,7 @@
import errno
import glob
import hashlib
import importlib.metadata as importlib_metadata
import itertools
import json
import logging
@ -23,13 +24,6 @@ import os.path
import struct
import sys
try:
# For python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# For everyone else
import importlib_metadata
log = logging.getLogger('stevedore._cache')

View File

@ -13,12 +13,7 @@
"""Tests for stevedore.extension
"""
try:
# For python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# For everyone else
import importlib_metadata
import importlib.metadata as importlib_metadata
from stevedore import driver
from stevedore import exception

View File

@ -13,16 +13,10 @@
"""Tests for stevedore.extension
"""
import importlib.metadata as importlib_metadata
import operator
from unittest import mock
try:
# For python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# For everyone else
import importlib_metadata
from stevedore import exception
from stevedore import extension
from stevedore.tests import utils

View File

@ -12,12 +12,7 @@
"""Tests for the sphinx extension
"""
try:
# For python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# For everyone else
import importlib_metadata
import importlib.metadata as importlib_metadata
from stevedore import extension
from stevedore import sphinxext