Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for inotify use #393

Merged
merged 2 commits into from
Dec 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cola/inotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from cola import gitcfg
from cola import core
from cola.compat import ustr
from cola.compat import ustr, PY3
from cola.git import STDOUT
from cola.i18n import N_
from cola.interaction import Interaction
Expand Down Expand Up @@ -181,9 +181,9 @@ def _watch_directory(self, directory):
return
self._dirs_seen.add(directory)
if core.exists(directory):
encoded_dir = core.encode(directory)
dir_arg = directory if PY3 else core.encode(directory)
try:
self._wmgr.add_watch(encoded_dir, self._mask, quiet=False)
self._wmgr.add_watch(dir_arg, self._mask, quiet=False)
except WatchManagerError as e:
self._add_watch_failed = True
self._add_watch_failed_warning(directory, e)
Expand All @@ -206,9 +206,9 @@ def _is_pyinotify_08x(self):
This allows us to maintain backwards compatibility.
"""
if hasattr(pyinotify, '__version__'):
if pyinotify.__version__[:3] == '0.8':
return True
return False
if pyinotify.__version__[:3] < '0.8':
return False
return True

def run(self):
"""Create the inotify WatchManager and generate FileSysEvents"""
Expand Down