Skip to content

Commit c8c83d1

Browse files
author
Diego Argueta
committed
Fix call to OSError constructor on Windows test, some lint stuff
1 parent b9b8444 commit c8c83d1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88

99
## Unreleased
1010

11-
### Added
12-
1311
### Changed
1412

1513
- Support more lenient usernames and group names in FTP servers

fs/error_tools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def __exit__(
8686
if _errno == errno.EACCES and sys.platform == "win32":
8787
windows_error = getattr(exc_value, "winerror", 0)
8888
exception_args = getattr(exc_value, "args", None) or (0,)
89-
if windows_error == 32 or exception_args[0] == errno.EACCES: # pragma: no cover
89+
if (
90+
windows_error == 32 or exception_args[0] == errno.EACCES
91+
): # pragma: no cover
9092
fserror = errors.ResourceLocked
9193
reraise(fserror, fserror(self._path, exc=exc_value), traceback)
9294

tests/test_error_tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def test_convert_enametoolong(self):
2727

2828
@unittest.skipIf(sys.platform != "win32", "requires Windows")
2929
def test_convert_resourcelocked_windows(self):
30-
exception = OSError(32, "resource locked")
30+
# errno should be ignored on Windows so we pass in a bogus number.
31+
exception = OSError(123456, "resource locked", None, 32)
3132
with self.assertRaises(fs.errors.ResourceLocked) as ctx:
3233
with convert_os_errors("stat", "/tmp/test"):
3334
raise exception

0 commit comments

Comments
 (0)