From 877e9423ac4b7b095d580feced740a2b8cae3b64 Mon Sep 17 00:00:00 2001 From: Diego Argueta Date: Thu, 29 Jul 2021 10:39:52 -0700 Subject: [PATCH] Fix #484 --- fs/error_tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/error_tools.py b/fs/error_tools.py index 66d38696..ba516eeb 100644 --- a/fs/error_tools.py +++ b/fs/error_tools.py @@ -84,7 +84,8 @@ def __exit__( _errno = exc_value.errno fserror = os_errors.get(_errno, errors.OperationFailed) if _errno == errno.EACCES and sys.platform == "win32": - if getattr(exc_value, "args", None) == 32: # pragma: no cover + error_args = getattr(exc_value, "args", (None,)) + if error_args and error_args[0] == 32: # pragma: no cover fserror = errors.ResourceLocked reraise(fserror, fserror(self._path, exc=exc_value), traceback)