1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30137 -- Replaced OSError aliases with the canonical OSError.

Used more specific errors (e.g. FileExistsError) as appropriate.
This commit is contained in:
Jon Dufresne
2019-01-28 07:01:35 -08:00
committed by Tim Graham
parent 7444f32527
commit 7785e03ba8
33 changed files with 60 additions and 69 deletions

View File

@@ -22,14 +22,14 @@ class HttpResponseBaseTests(SimpleTestCase):
r = HttpResponseBase()
self.assertIs(r.writable(), False)
with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance is not writable'):
with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance is not writable'):
r.write('asdf')
with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance is not writable'):
with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance is not writable'):
r.writelines(['asdf\n', 'qwer\n'])
def test_tell(self):
r = HttpResponseBase()
with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance cannot tell its position'):
with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance cannot tell its position'):
r.tell()
def test_setdefault(self):