Skip to content

Commit da8001d

Browse files
authored
Merge pull request #218 from zhy1985555/master
兼容python3.10
2 parents 60b602d + 24091f0 commit da8001d

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ python:
66
- '3.6'
77
- '3.8'
88
- '3.9'
9+
- "3.10"
910
install:
1011
- pip install requests
1112
- pip install six

qcloud_cos/cos_client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
from .select_event_stream import EventStream
3131
from .resumable_downloader import ResumableDownLoader
3232

33+
# python 3.10报错"module 'collections' has no attribute 'Iterable'",这里先规避
34+
if sys.version_info.major >= 3 and sys.version_info.minor >= 10:
35+
import collections.abc
36+
collections.Iterable = collections.abc.Iterable
37+
3338
logger = logging.getLogger(__name__)
3439

3540

@@ -253,14 +258,14 @@ def set_built_in_connection_pool_max_size(self, PoolConnections, PoolMaxSize):
253258
# 重新绑定到内置连接池
254259
if rebound:
255260
self._session = CosS3Client.__built_in_sessions
256-
logger.warn("rebound built-in connection pool success. maxsize=%d,%d" % (PoolConnections, PoolMaxSize))
261+
logger.info("rebound built-in connection pool success. maxsize=%d,%d" % (PoolConnections, PoolMaxSize))
257262

258263
def generate_built_in_connection_pool(self, PoolConnections, PoolMaxSize):
259264
"""生成SDK内置的连接池,此连接池是client间共用的"""
260265
built_in_sessions = requests.session()
261266
built_in_sessions.mount('http://', requests.adapters.HTTPAdapter(pool_connections=PoolConnections, pool_maxsize=PoolMaxSize))
262267
built_in_sessions.mount('https://', requests.adapters.HTTPAdapter(pool_connections=PoolConnections, pool_maxsize=PoolMaxSize))
263-
logger.warn("generate built-in connection pool success. maxsize=%d,%d" % (PoolConnections, PoolMaxSize))
268+
logger.info("generate built-in connection pool success. maxsize=%d,%d" % (PoolConnections, PoolMaxSize))
264269
return built_in_sessions
265270

266271
def get_conf(self):

qcloud_cos/cos_threadpool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def run(self):
3030
self._ret.append(ret)
3131

3232
except Exception as e:
33-
logger.warn(str(e))
33+
logger.error(str(e))
3434
self._fail_task_num += 1
3535
if hasattr(e, '_message') and e._message:
3636
self._ret.append(e._message)

qcloud_cos/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '5.1.9.19'
1+
__version__ = '5.1.9.20'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def long_description():
3333

3434
setup(
3535
name='cos-python-sdk-v5',
36-
version='1.9.19',
36+
version='1.9.20',
3737
url='https://www.qcloud.com/',
3838
license='MIT',
3939
author='tiedu, lewzylu, channingliu',

0 commit comments

Comments
 (0)