From 4a35f513ab5acf8329152f64da1eb22626dc1b52 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sat, 14 Oct 2023 13:04:20 +0200 Subject: [PATCH] fix error in test_contracts.py on win --- psutil/tests/test_contracts.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py index 152a5b739..2874c0d90 100755 --- a/psutil/tests/test_contracts.py +++ b/psutil/tests/test_contracts.py @@ -668,8 +668,7 @@ def cwd(self, ret, info): try: st = os.stat(ret) except OSError as err: - if WINDOWS and err.errno in \ - psutil._psplatform.ACCESS_DENIED_SET: + if WINDOWS and psutil._psplatform.is_permission_err(err): pass # directory has been removed in mean time elif err.errno != errno.ENOENT: