File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -396,13 +396,20 @@ def parse_item(item):
396396 # an O(N) complexity) instead of the command.
397397 if isinstance (item [3 ], list ):
398398 result ["command" ] = space .join (item [3 ])
399- result ["client_address" ] = item [4 ]
400- result ["client_name" ] = item [5 ]
399+
400+ # These fields are optional, depends on environment.
401+ if len (item ) >= 6 :
402+ result ["client_address" ] = item [4 ]
403+ result ["client_name" ] = item [5 ]
401404 else :
402405 result ["complexity" ] = item [3 ]
403406 result ["command" ] = space .join (item [4 ])
404- result ["client_address" ] = item [5 ]
405- result ["client_name" ] = item [6 ]
407+
408+ # These fields are optional, depends on environment.
409+ if len (item ) >= 7 :
410+ result ["client_address" ] = item [5 ]
411+ result ["client_name" ] = item [6 ]
412+
406413 return result
407414
408415 return [parse_item (item ) for item in response ]
Original file line number Diff line number Diff line change @@ -1521,8 +1521,8 @@ def test_set_path(client):
15211521
15221522 root = tempfile .mkdtemp ()
15231523 sub = tempfile .mkdtemp (dir = root )
1524- jsonfile = tempfile .mktemp (suffix = ".json" , dir = sub )
1525- nojsonfile = tempfile .mktemp (dir = root )
1524+ jsonfile = tempfile .mkstemp (suffix = ".json" , dir = sub )[ 1 ]
1525+ nojsonfile = tempfile .mkstemp (dir = root )[ 1 ]
15261526
15271527 with open (jsonfile , "w+" ) as fp :
15281528 fp .write (json .dumps ({"hello" : "world" }))
You can’t perform that action at this time.
0 commit comments