1- #!/usr/bin/env python
1+ #!/usr/bin/env python3
22
33# Copyright JS Foundation and other contributors, http://js.foundation
44#
1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17- from __future__ import print_function
1817from cmd import Cmd
1918from pprint import pprint
2019import math
@@ -104,7 +103,7 @@ def do_next(self, args):
104103 if res_type == result .END :
105104 self .quit = True
106105 return
107- elif res_type == result .TEXT :
106+ if res_type == result .TEXT :
108107 write (result .get_text ())
109108 elif res_type == result .PROMPT :
110109 break
@@ -279,6 +278,7 @@ def main():
279278
280279 protocol = Socket (address )
281280 elif args .protocol == "serial" :
281+ # pylint: disable=import-outside-toplevel
282282 from jerry_client_serial import Serial
283283 protocol = Serial (args .serial_config )
284284 else :
@@ -325,7 +325,7 @@ def main():
325325
326326 if res_type == result .END :
327327 break
328- elif res_type == result .PROMPT :
328+ if res_type == result .PROMPT :
329329 prompt .cmdloop ()
330330 elif res_type == result .TEXT :
331331 write (result .get_text ())
@@ -339,7 +339,7 @@ def main():
339339 MSG = str (error_msg )
340340 if ERRNO == 111 :
341341 sys .exit ("Failed to connect to the JerryScript debugger." )
342- elif ERRNO == 32 or ERRNO == 104 :
342+ elif ERRNO in ( 32 , 104 ) :
343343 sys .exit ("Connection closed." )
344344 else :
345345 sys .exit ("Failed to connect to the JerryScript debugger.\n Error: %s" % (MSG ))
0 commit comments