summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/vfs_fat_fileio1.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-04-22 19:32:21 +1000
committerDamien George <damien@micropython.org>2021-04-23 22:03:46 +1000
commit3123f6918ba18b0a3f7a89500b450f4cb15e1aee (patch)
tree0916d58b5685fdfcf968004621b7766d3b2046fd /tests/extmod/vfs_fat_fileio1.py
parent342d55529d6f3312fc158d7af005f56d5e30adef (diff)
downloadmicropython-3123f6918ba18b0a3f7a89500b450f4cb15e1aee.tar.gz
micropython-3123f6918ba18b0a3f7a89500b450f4cb15e1aee.zip
tests: Use .errno instead of .args[0] for OSError exceptions.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/vfs_fat_fileio1.py')
-rw-r--r--tests/extmod/vfs_fat_fileio1.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/extmod/vfs_fat_fileio1.py b/tests/extmod/vfs_fat_fileio1.py
index e42911093f..7da08b80cf 100644
--- a/tests/extmod/vfs_fat_fileio1.py
+++ b/tests/extmod/vfs_fat_fileio1.py
@@ -58,22 +58,22 @@ f.close() # allowed
try:
f.write("world!")
except OSError as e:
- print(e.args[0] == uerrno.EINVAL)
+ print(e.errno == uerrno.EINVAL)
try:
f.read()
except OSError as e:
- print(e.args[0] == uerrno.EINVAL)
+ print(e.errno == uerrno.EINVAL)
try:
f.flush()
except OSError as e:
- print(e.args[0] == uerrno.EINVAL)
+ print(e.errno == uerrno.EINVAL)
try:
open("foo_file.txt", "x")
except OSError as e:
- print(e.args[0] == uerrno.EEXIST)
+ print(e.errno == uerrno.EEXIST)
with open("foo_file.txt", "a") as f:
f.write("world!")
@@ -105,7 +105,7 @@ vfs.mkdir("foo_dir")
try:
vfs.rmdir("foo_file.txt")
except OSError as e:
- print(e.args[0] == 20) # uerrno.ENOTDIR
+ print(e.errno == 20) # uerrno.ENOTDIR
vfs.remove("foo_file.txt")
print(list(vfs.ilistdir()))