@@ -1276,21 +1276,26 @@ def client_info(self):
1276
1276
"""
1277
1277
return self .execute_command ('CLIENT INFO' )
1278
1278
1279
- def client_list (self , _type = None ):
1279
+ def client_list (self , _type = None , client_id = None ):
1280
1280
"""
1281
1281
Returns a list of currently connected clients.
1282
1282
If type of client specified, only that type will be returned.
1283
1283
:param _type: optional. one of the client types (normal, master,
1284
1284
replica, pubsub)
1285
1285
"""
1286
1286
"Returns a list of currently connected clients"
1287
+ args = []
1287
1288
if _type is not None :
1288
1289
client_types = ('normal' , 'master' , 'replica' , 'pubsub' )
1289
1290
if str (_type ).lower () not in client_types :
1290
1291
raise DataError ("CLIENT LIST _type must be one of %r" % (
1291
1292
client_types ,))
1292
- return self .execute_command ('CLIENT LIST' , b'TYPE' , _type )
1293
- return self .execute_command ('CLIENT LIST' )
1293
+ args .append (b'TYPE' )
1294
+ args .append (_type )
1295
+ if client_id is not None :
1296
+ args .append (b"ID" )
1297
+ args .append (client_id )
1298
+ return self .execute_command ('CLIENT LIST' , * args )
1294
1299
1295
1300
def client_getname (self ):
1296
1301
"Returns the current connection name"
@@ -3053,9 +3058,7 @@ def zadd(self, name, mapping, nx=False, xx=False, ch=False, incr=False,
3053
3058
raise DataError ("ZADD option 'incr' only works when passing a "
3054
3059
"single element/score pair" )
3055
3060
if nx is True and (gt is not None or lt is not None ):
3056
- raise DataError ("Only one of 'nx', 'lt', or 'gt' may be defined." )
3057
- if gt is not None and lt is not None :
3058
- raise DataError ("Only one of 'gt' or 'lt' can be set." )
3061
+ raise DataError ("Only one of 'nx', 'lt', or 'gr' may be defined." )
3059
3062
3060
3063
pieces = []
3061
3064
options = {}
0 commit comments