mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix some py3k warnings in the standard library.
This commit is contained in:
parent
2a4ab81633
commit
1f3b4e12e8
9 changed files with 45 additions and 40 deletions
|
@ -133,9 +133,7 @@ class MemoryTestMixin:
|
|||
pos = memio.tell()
|
||||
self.assertEqual(memio.truncate(None), pos)
|
||||
self.assertEqual(memio.tell(), pos)
|
||||
# Silence a py3k warning
|
||||
with support.check_warnings():
|
||||
self.assertRaises(TypeError, memio.truncate, '0')
|
||||
self.assertRaises(TypeError, memio.truncate, '0')
|
||||
memio.close()
|
||||
self.assertRaises(ValueError, memio.truncate, 0)
|
||||
|
||||
|
@ -172,9 +170,7 @@ class MemoryTestMixin:
|
|||
self.assertEqual(type(memio.read()), type(buf))
|
||||
memio.seek(0)
|
||||
self.assertEqual(memio.read(None), buf)
|
||||
# Silence a py3k warning
|
||||
with support.check_warnings():
|
||||
self.assertRaises(TypeError, memio.read, '')
|
||||
self.assertRaises(TypeError, memio.read, '')
|
||||
memio.close()
|
||||
self.assertRaises(ValueError, memio.read)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue