Skip to content

Commit bce4b88

Browse files
olegrokTotktonada
authored andcommitted
Fix deprecation warning re import from collections
| /usr/local/lib/python3.7/site-packages/tarantool/response.py:25 | /usr/local/lib/python3.7/site-packages/tarantool/response.py:25: | DeprecationWarning: Using or importing the ABCs from 'collections' | instead of from 'collections.abc' is deprecated, and in 3.8 it will | stop working | class Response(collections.Sequence):
1 parent debe676 commit bce4b88

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tarantool/response.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# -*- coding: utf-8 -*-
22
# pylint: disable=C0301,W0105,W0401,W0614
33

4-
import collections
4+
try:
5+
# Python 3.3+
6+
from collections.abc import Sequence
7+
except ImportError:
8+
# Python 2
9+
from collections import Sequence
510

611
import json
712
import msgpack
@@ -22,7 +27,7 @@
2227
)
2328

2429

25-
class Response(collections.Sequence):
30+
class Response(Sequence):
2631
'''
2732
Represents a single response from the server in compliance with the
2833
Tarantool protocol.

0 commit comments

Comments
 (0)