diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index 05044be60..88c72773d 100755 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -552,7 +552,7 @@ def test_num_handles(self): def test_error_partial_copy(self): # https://github.com/giampaolo/psutil/issues/875 - exc = WindowsError() + exc = OSError() exc.winerror = 299 with mock.patch("psutil._psplatform.cext.proc_cwd", side_effect=exc): with mock.patch("time.sleep") as m: @@ -883,7 +883,7 @@ def test_win_service_get(self): # test NoSuchProcess service = psutil.win_service_get(name) - exc = WindowsError(0, "msg", 0, ERROR_SERVICE_DOES_NOT_EXIST) + exc = OSError(0, "msg", 0, winerror=ERROR_SERVICE_DOES_NOT_EXIST) with mock.patch( "psutil._psplatform.cext.winservice_query_status", side_effect=exc ): @@ -896,7 +896,7 @@ def test_win_service_get(self): service.username() # test AccessDenied - exc = WindowsError(0, "msg", 0, ERROR_ACCESS_DENIED) + exc = OSError(0, "msg", 0, winerror=ERROR_ACCESS_DENIED) with mock.patch( "psutil._psplatform.cext.winservice_query_status", side_effect=exc ): diff --git a/pyproject.toml b/pyproject.toml index f029446e4..518347cb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,6 @@ ignore = [ "TD", # all TODOs, XXXs, etc. "TRY300", # Consider moving this statement to an `else` block "TRY301", # Abstract `raise` to an inner function - "UP024", # [*] Replace aliased errors with `OSError` (PYTHON2.7 COMPAT) "UP031", # [*] Use format specifiers instead of percent format ]