Raise OSError with errno=ENOENT from uv watcher

Fixes #1066
This commit is contained in:
ZyX 2014-09-07 23:20:49 +04:00
parent 5f37ab7e3e
commit 9f7286e4e9

View File

@ -7,6 +7,7 @@ from collections import defaultdict
from threading import RLock from threading import RLock
from functools import partial from functools import partial
from threading import Thread from threading import Thread
from errno import ENOENT
from powerline.lib.path import realpath from powerline.lib.path import realpath
@ -76,7 +77,7 @@ class UvWatcher(object):
except pyuv.error.FSEventError as e: except pyuv.error.FSEventError as e:
code = e.args[0] code = e.args[0]
if code == pyuv.errno.UV_ENOENT: if code == pyuv.errno.UV_ENOENT:
raise OSError('No such file or directory: ' + path) raise OSError(ENOENT, 'No such file or directory: ' + path)
else: else:
raise raise