1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 01:27:07 +00:00

no log: fix for Python 3.7

This commit is contained in:
morpheus65535 2022-11-07 13:31:58 -05:00
parent bbe2483e21
commit 4f060207ab
5 changed files with 29 additions and 6 deletions

View file

@ -15,7 +15,6 @@
import errno
import glob
import hashlib
import importlib.metadata as importlib_metadata
import itertools
import json
import logging
@ -24,6 +23,13 @@ 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')
@ -104,7 +110,8 @@ def _build_cacheable_data():
# importlib-metadata 4.0 or later (or stdlib importlib.metadata in
# Python 3.9 or later)
real_groups = {
name: real_groups.select(name=name) for name in real_groups.names
group: real_groups.select(group=group)
for group in real_groups.groups
}
# Convert the namedtuple values to regular tuples

View file

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

View file

@ -13,10 +13,16 @@
"""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,7 +12,12 @@
"""Tests for the sphinx extension
"""
import importlib.metadata as importlib_metadata
try:
# For python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# For everyone else
import importlib_metadata
from stevedore import extension
from stevedore import sphinxext

View file

@ -103,7 +103,7 @@ babelfish==0.6.0
beautifulsoup4==4.11.1
chardet==5.0.0
pysrt==1.1.2
stevedore==4.1.0
#stevedore==3.5.2 # Do not upgrade. Version newer than that have issues with importlib on Python 3.7
# Required-by: subliminal_patch
cloudscraper==1.2.58