summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/vfs_fat_fileio.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-24 12:59:20 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-24 12:59:20 +1100
commit56942019309645781d330312f5944db2d4cb5cd7 (patch)
treef5410a2c3d933dad4b1423ec093fe97f70bd5607 /tests/extmod/vfs_fat_fileio.py
parent06e703290640ed6326bf70e172c25be92799591f (diff)
downloadmicropython-56942019309645781d330312f5944db2d4cb5cd7.tar.gz
micropython-56942019309645781d330312f5944db2d4cb5cd7.zip
extmod/vfs_fat_file: Make file.close() a no-op if file already closed.
As per CPython semantics. In particular, file.__del__() should not raise an exception if the file is already closed.
Diffstat (limited to 'tests/extmod/vfs_fat_fileio.py')
-rw-r--r--tests/extmod/vfs_fat_fileio.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/extmod/vfs_fat_fileio.py b/tests/extmod/vfs_fat_fileio.py
index 26fec78281..de8d4953c4 100644
--- a/tests/extmod/vfs_fat_fileio.py
+++ b/tests/extmod/vfs_fat_fileio.py
@@ -48,6 +48,7 @@ print(str(f)[:17], str(f)[-1:])
f.write("hello!")
f.flush()
f.close()
+f.close() # allowed
try:
f.write("world!")
except OSError as e:
@@ -64,11 +65,6 @@ except OSError as e:
print(e.args[0] == uerrno.EINVAL)
try:
- f.close()
-except OSError as e:
- print(e.args[0] == uerrno.EINVAL)
-
-try:
vfs.open("foo_file.txt", "x")
except OSError as e:
print(e.args[0] == uerrno.EEXIST)