From 6c01453fd3f5c09399eb8b5dce0a6cd0ad177d2c Mon Sep 17 00:00:00 2001 From: Julian David Rath Date: Tue, 12 Apr 2016 08:53:04 +0200 Subject: [PATCH] throwing a WindowsError with the code --- send2trash/plat_win.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/send2trash/plat_win.py b/send2trash/plat_win.py index 3a55b9d..b35c422 100644 --- a/send2trash/plat_win.py +++ b/send2trash/plat_win.py @@ -54,6 +54,4 @@ def send2trash(path): fileop.lpszProgressTitle = None result = SHFileOperationW(byref(fileop)) if result: - msg = "Couldn't perform operation. Error code: %d" % result - raise OSError(msg) - + raise WindowsError(None, None, path, result)