Skip to content

Commit

Permalink
Merge pull request gorakhargosh#270 from Falldog/windows_shutdown_issue
Browse files Browse the repository at this point in the history
fix the issue: watch & unwatch the same folder on Windows
  • Loading branch information
tamland committed Sep 10, 2014
2 parents 5ba73b9 + f7538a6 commit 72ca07d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/watchdog/observers/winapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,12 @@ def get_directory_handle(path):
def close_directory_handle(handle):
try:
CancelIoEx(handle, None) # force ReadDirectoryChangesW to return
CloseHandle(handle) # close directory handle
except WindowsError:
return
try:
CloseHandle(handle) # close directory handle
except:
return


def read_directory_changes(handle, recursive):
Expand Down

0 comments on commit 72ca07d

Please sign in to comment.