File tree 2 files changed +4
-13
lines changed
2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change 4
4
'''
5
5
6
6
import sys
7
- import collections
8
7
import msgpack
9
8
import hashlib
10
9
11
- try :
12
- collectionsAbc = collections .abc
13
- except AttributeError :
14
- collectionsAbc = collections
10
+ from collections .abc import Sequence , Mapping
15
11
16
12
17
13
from tarantool .error import DatabaseError
@@ -406,9 +402,9 @@ class RequestExecute(Request):
406
402
407
403
def __init__ (self , conn , sql , args ):
408
404
super (RequestExecute , self ).__init__ (conn )
409
- if isinstance (args , collectionsAbc . Mapping ):
405
+ if isinstance (args , Mapping ):
410
406
args = [{":%s" % name : value } for name , value in args .items ()]
411
- elif not isinstance (args , collectionsAbc . Sequence ):
407
+ elif not isinstance (args , Sequence ):
412
408
raise TypeError ("Parameter type '%s' is not supported. "
413
409
"Must be a mapping or sequence" % type (args ))
414
410
Original file line number Diff line number Diff line change 1
1
# pylint: disable=C0301,W0105,W0401,W0614
2
2
3
- try :
4
- # Python 3.3+
5
- from collections .abc import Sequence
6
- except ImportError :
7
- # Python 2
8
- from collections import Sequence
3
+ from collections .abc import Sequence
9
4
10
5
import json
11
6
import msgpack
You can’t perform that action at this time.
0 commit comments