mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
use io.SEEK_* constants instead of os.SEEK_* where an IO stream is seeked, leaving the os.SEEK_* constants only for os.lseek, as documented
This commit is contained in:
parent
c041ab6c7d
commit
74c503b40d
2 changed files with 8 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
import io
|
||||
import errno
|
||||
import unittest
|
||||
from array import array
|
||||
|
@ -334,10 +335,10 @@ class OtherFileTests(unittest.TestCase):
|
|||
self.assertEqual(f.tell(), 10)
|
||||
f.truncate(5)
|
||||
self.assertEqual(f.tell(), 10)
|
||||
self.assertEqual(f.seek(0, os.SEEK_END), 5)
|
||||
self.assertEqual(f.seek(0, io.SEEK_END), 5)
|
||||
f.truncate(15)
|
||||
self.assertEqual(f.tell(), 5)
|
||||
self.assertEqual(f.seek(0, os.SEEK_END), 15)
|
||||
self.assertEqual(f.seek(0, io.SEEK_END), 15)
|
||||
f.close()
|
||||
|
||||
def testTruncateOnWindows(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue