Skip to content

Commit 80be99f

Browse files
committed
Fix file write under Python 2 in xmp.py
I broke it with my locking fixes, apparently I only tested reading under Python 2. (In Python 3 file.write returns the length, so I thought that was true in Python 2 as well.) Sorry.
1 parent 4eb0742 commit 80be99f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

example/xmp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ def write(self, buf, offset):
190190
self.iolock.acquire()
191191
try:
192192
self.file.seek(offset)
193-
return self.file.write(buf)
193+
self.file.write(buf)
194+
return len(buf)
194195
finally:
195196
self.iolock.release()
196197
else:

0 commit comments

Comments
 (0)