File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -323,11 +323,13 @@ def get_stats(self, stat_args=None):
323
323
serverData = {}
324
324
data .append ((name , serverData ))
325
325
readline = s .readline
326
- while 1 :
326
+ while True :
327
327
line = readline ()
328
- if not line or line .decode ('ascii' ).strip () == 'END' :
328
+ if line :
329
+ line = line .decode ('ascii' )
330
+ if not line or line .strip () == 'END' :
329
331
break
330
- stats = line .decode ( 'ascii' ). split (' ' , 2 )
332
+ stats = line .split (' ' , 2 )
331
333
serverData [stats [1 ]] = stats [2 ]
332
334
333
335
return data
@@ -347,8 +349,10 @@ def get_slab_stats(self):
347
349
data .append ((name , serverData ))
348
350
s .send_cmd ('stats slabs' )
349
351
readline = s .readline
350
- while 1 :
352
+ while True :
351
353
line = readline ()
354
+ if line :
355
+ line = line .decode ('ascii' )
352
356
if not line or line .strip () == 'END' :
353
357
break
354
358
item = line .split (' ' , 2 )
@@ -378,7 +382,7 @@ def get_slabs(self):
378
382
data .append ((name , serverData ))
379
383
s .send_cmd ('stats items' )
380
384
readline = s .readline
381
- while 1 :
385
+ while True :
382
386
line = readline ()
383
387
if not line or line .strip () == 'END' :
384
388
break
You can’t perform that action at this time.
0 commit comments