浏览代码

Cope with pyinotify not being installed.

Jelmer Vernooij 4 年之前
父节点
当前提交
c37b9ecf85
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 1
      dulwich/tests/test_refs.py
  2. 1 0
      setup.py

+ 1 - 1
dulwich/tests/test_refs.py

@@ -326,7 +326,7 @@ class RefsContainerTests(object):
     def test_watch(self):
         try:
             watcher = self._refs.watch()
-        except NotImplementedError:
+        except (NotImplementedError, ImportError):
             self.skipTest('watching not supported')
         with watcher:
             self._refs[b'refs/remotes/origin/other'] = (

+ 1 - 0
setup.py

@@ -77,6 +77,7 @@ if has_setuptools:
         'fastimport': ['fastimport'],
         'https': ['urllib3[secure]>=1.24.1'],
         'pgp': ['gpg'],
+        'watch': ['pyinotify'],
         }
     setup_kwargs['install_requires'] = ['urllib3>=1.24.1', 'certifi']
     setup_kwargs['include_package_data'] = True