diff --git a/tools/commissioner_thci/commissioner.py b/tools/commissioner_thci/commissioner.py index fecd24dc..c9b1c192 100644 --- a/tools/commissioner_thci/commissioner.py +++ b/tools/commissioner_thci/commissioner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019, The OpenThread Commissioner Authors. diff --git a/tools/commissioner_thci/commissioner_ctl.py b/tools/commissioner_thci/commissioner_ctl.py index f7e7b038..8a4e0cb6 100755 --- a/tools/commissioner_thci/commissioner_ctl.py +++ b/tools/commissioner_thci/commissioner_ctl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019, The OpenThread Commissioner Authors. @@ -30,8 +30,6 @@ Commissioner daemon controller """ -from __future__ import print_function - import os import argparse import multiprocessing.connection diff --git a/tools/commissioner_thci/commissioner_impl.py b/tools/commissioner_thci/commissioner_impl.py index 38479e39..fc8c9ebb 100644 --- a/tools/commissioner_thci/commissioner_impl.py +++ b/tools/commissioner_thci/commissioner_impl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019, The OpenThread Commissioner Authors. @@ -194,7 +194,7 @@ def getSessionId(self): raise_(commissioner.Error, repr(e), sys.exc_info()[2]) def MGMT_COMMISSIONER_GET(self, tlvTypes): - types = ' '.join(map(lambda x: TLV_TYPE_TO_STRING[x], tlvTypes)) + types = ' '.join([TLV_TYPE_TO_STRING[x] for x in tlvTypes]) command = 'commdataset get ' + types response = self._execute_and_check(command) @@ -252,7 +252,7 @@ def disableJoiner(self, joinerType, eui64=None): self._execute_and_check(' '.join(command)) def MGMT_ACTIVE_GET(self, tlvTypes): - types = ' '.join(map(lambda x: TLV_TYPE_TO_STRING[x], tlvTypes)) + types = ' '.join([TLV_TYPE_TO_STRING[x] for x in tlvTypes]) result = self._execute_and_check( 'opdataset get active {}'.format(types)) @@ -267,7 +267,7 @@ def MGMT_ACTIVE_SET(self, activeOpDataset): OTCommissioner._active_op_dataset_to_json(activeOpDataset))) def MGMT_PENDING_GET(self, tlvTypes): - types = ' '.join(map(lambda x: TLV_TYPE_TO_STRING[x], tlvTypes)) + types = ' '.join([TLV_TYPE_TO_STRING[x] for x in tlvTypes]) result = self._execute_and_check( 'opdataset get pending {}'.format(types)) @@ -282,7 +282,7 @@ def MGMT_PENDING_SET(self, pendingOpDataset): OTCommissioner._pending_op_dataset_to_json(pendingOpDataset))) def MGMT_BBR_GET(self, tlvTypes): - types = ' '.join(map(lambda x: TLV_TYPE_TO_STRING[x], tlvTypes)) + types = ' '.join([TLV_TYPE_TO_STRING[x] for x in tlvTypes]) result = self._execute_and_check('bbrdataset get {}'.format(types)) try: diff --git a/tools/commissioner_thci/commissionerd.py b/tools/commissioner_thci/commissionerd.py index 7571a800..1ad038ee 100755 --- a/tools/commissioner_thci/commissionerd.py +++ b/tools/commissioner_thci/commissionerd.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019, The OpenThread Commissioner Authors. @@ -30,8 +30,6 @@ Commissioner daemon process """ -from __future__ import print_function - import os import multiprocessing.connection import sys diff --git a/tools/commissioner_thci/example_send_mlr.py b/tools/commissioner_thci/example_send_mlr.py index 938473ac..3c9e8ffd 100644 --- a/tools/commissioner_thci/example_send_mlr.py +++ b/tools/commissioner_thci/example_send_mlr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019, The OpenThread Commissioner Authors. @@ -71,8 +71,8 @@ def test_mlr(): comm.start(BORDER_AGENT_ADDR, BORDER_AGENT_PORT) assert comm.isActive() - print("commissioner connected, session ID = {}".format( - comm.getSessionId())) + print(("commissioner connected, session ID = {}".format( + comm.getSessionId()))) ## Send MLR.req comm.MLR([MA1, MA2], 60)