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
changes/15/847015/1 4.0.0
Takashi Kajinami 8 months ago
parent 8efaa1ceb8
commit ccd17543a3

@ -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

@ -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')

@ -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

@ -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

@ -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

Loading…
Cancel
Save