make poor old afmLib work on py3
This commit is contained in:
parent
d08d635a93
commit
0eb40c6346
@ -338,7 +338,7 @@ class AFM(object):
|
|||||||
|
|
||||||
def readlines(path):
|
def readlines(path):
|
||||||
f = open(path, 'rb')
|
f = open(path, 'rb')
|
||||||
data = f.read()
|
data = f.read().decode("ascii")
|
||||||
f.close()
|
f.close()
|
||||||
# read any text file, regardless whether it's formatted for Mac, Unix or Dos
|
# read any text file, regardless whether it's formatted for Mac, Unix or Dos
|
||||||
sep = ""
|
sep = ""
|
||||||
@ -351,7 +351,7 @@ def readlines(path):
|
|||||||
def writelines(path, lines, sep='\r'):
|
def writelines(path, lines, sep='\r'):
|
||||||
f = open(path, 'wb')
|
f = open(path, 'wb')
|
||||||
for line in lines:
|
for line in lines:
|
||||||
f.write(line + sep)
|
f.write((line + sep).encode("ascii"))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user