src/eric7/MicroPython/Devices/DeviceBase.py

branch
eric7
changeset 10095
0e6da289da44
parent 10083
62019277dd0a
child 10138
56614cf9d03c
equal deleted inserted replaced
10094:b8de8b751b38 10095:0e6da289da44
846 @exception OSError raised to indicate an issue with the device 846 @exception OSError raised to indicate an issue with the device
847 """ 847 """
848 if not deviceFileName: 848 if not deviceFileName:
849 raise OSError("Missing device file name") 849 raise OSError("Missing device file name")
850 850
851 # convert eol '\r' 851 # convert eol to '\n'
852 content = content.replace(b"\r\n", b"\r") 852 content = content.replace(b"\r\n", b"\n")
853 content = content.replace(b"\n", b"\r") 853 content = content.replace(b"\r", b"\n")
854 854
855 commands = [ 855 commands = [
856 "fd = open('{0}', 'wb')".format(deviceFileName), 856 "fd = open('{0}', 'wb')".format(deviceFileName),
857 "f = fd.write", 857 "f = fd.write",
858 ] 858 ]

eric ide

mercurial