old_contents: #!/usr/bin/python3
  # -*- coding:utf-8 -*-
  import serial
  
  ser = serial.Serial("/dev/ttyS0",115200)
  
  print('serial test start ...')
  ser.write("Hello Wrold !!!\n")
  try:
          while True:
                      ser.write(ser.read())
  except KeyboardInterrupt:
          if ser != None:
                      ser.close()
  
new_contents: #!/usr/bin/python
  # -*- coding:utf-8 -*-
  import serial
  
  ser = serial.Serial("/dev/ttyS0",115200)
  
  print('serial test start ...')
  ser.write("Hello Wrold !!!\n")
  try:
          while True:
                      ser.write(ser.read())
  except KeyboardInterrupt:
          if ser != None:
                      ser.close()
  
subject: change python3 to python