Mercurial > hg
comparison mercurial/__init__.py @ 33502:5d0c0c8d2929
selector2: vendor selector2 library
This library was a backport of the Python 3 "selectors" library. It is
useful to provide a better selector interface for Python2, to address some
issues of the plain old select.select, mentioned in the next patch.
The code [1] was ported using the MIT license, with some minor modifications
to make our test happy:
1. "# no-check-code" was added since it's foreign code.
2. "from __future__ import absolute_import" was added.
3. "from collections import namedtuple, Mapping" changed to avoid direct
symbol import.
[1]: https://github.com/SethMichaelLarson/selectors2/blob/d27dbd2fdc48331fb76ed431f44b6e6956de7f82/selectors2.py
# no-check-commit
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 14 Jul 2017 20:19:46 -0700 |
parents | 942051a29fb6 |
children | 9fb9f8440b71 |
comparison
equal
deleted
inserted
replaced
33501:7008f6819002 | 33502:5d0c0c8d2929 |
---|---|
28 class hgpathentryfinder(importlib.abc.MetaPathFinder): | 28 class hgpathentryfinder(importlib.abc.MetaPathFinder): |
29 """A sys.meta_path finder that uses a custom module loader.""" | 29 """A sys.meta_path finder that uses a custom module loader.""" |
30 def find_spec(self, fullname, path, target=None): | 30 def find_spec(self, fullname, path, target=None): |
31 # Only handle Mercurial-related modules. | 31 # Only handle Mercurial-related modules. |
32 if not fullname.startswith(('mercurial.', 'hgext.', 'hgext3rd.')): | 32 if not fullname.startswith(('mercurial.', 'hgext.', 'hgext3rd.')): |
33 return None | |
34 # selectors2 is already dual-version clean, don't try and mangle it | |
35 if fullname.startswith('mercurial.selectors2'): | |
33 return None | 36 return None |
34 # zstd is already dual-version clean, don't try and mangle it | 37 # zstd is already dual-version clean, don't try and mangle it |
35 if fullname.startswith('mercurial.zstd'): | 38 if fullname.startswith('mercurial.zstd'): |
36 return None | 39 return None |
37 # pywatchman is already dual-version clean, don't try and mangle it | 40 # pywatchman is already dual-version clean, don't try and mangle it |