Apparently Python 3.12 no longer raises FileNotFoundError when closing a deleted file
Fixes #6360 (I hope) dont have time to actually test with pre-release python builds
This commit is contained in:
parent
b96a261a35
commit
4c5f4c4baf
1 changed files with 4 additions and 3 deletions
|
|
@ -8,6 +8,7 @@
|
|||
import unittest
|
||||
import zlib
|
||||
from base64 import standard_b64decode, standard_b64encode
|
||||
from contextlib import suppress
|
||||
from dataclasses import dataclass
|
||||
from io import BytesIO
|
||||
from itertools import cycle
|
||||
|
|
@ -364,9 +365,9 @@ def test_load_images(self):
|
|||
self.assertTrue(os.path.exists(f.name))
|
||||
f.seek(0), f.truncate(), f.write(compressed_random_data), f.flush()
|
||||
sl(f.name, s=24, v=32, t='t', o='z', expecting_data=random_data)
|
||||
self.assertRaises(
|
||||
FileNotFoundError, f.close
|
||||
) # check that file was deleted
|
||||
self.assertFalse(os.path.exists(f.name), f'Temp file at {f.name} was not deleted')
|
||||
with suppress(FileNotFoundError):
|
||||
f.close()
|
||||
|
||||
# Test loading from POSIX SHM
|
||||
name = '/kitty-test-shm'
|
||||
|
|
|
|||
Loading…
Reference in a new issue