mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +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:
parent
7444f32527
commit
7785e03ba8
33 changed files with 60 additions and 69 deletions
|
@ -191,11 +191,11 @@ class FileSystemLoaderTests(SimpleTestCase):
|
|||
tmppath = os.path.join(tmpdir, tmpfile.name)
|
||||
os.chmod(tmppath, 0o0222)
|
||||
with self.set_dirs([tmpdir]):
|
||||
with self.assertRaisesMessage(IOError, 'Permission denied'):
|
||||
with self.assertRaisesMessage(PermissionError, 'Permission denied'):
|
||||
self.engine.get_template(tmpfile.name)
|
||||
|
||||
def test_notafile_error(self):
|
||||
with self.assertRaises(IOError):
|
||||
with self.assertRaises(IsADirectoryError):
|
||||
self.engine.get_template('first')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue