Mercurial > hg
annotate mercurial/thirdparty/attr/_config.py @ 39969:208cb7a9d0fa
rust-chg: add function to send fds via domain socket
As a beginning, I wrote some C.
It's extracted from attachio() of contrib/chg/hgclient.c. Maybe it could
be rewritten in Rust by using the libc (and/or nix) crates, but doing that
wouldn't be trivial as the code depends on CMSG_*() macros. IMO, using C
is better here.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 24 Sep 2018 16:14:35 +0900 |
parents | 765eb17a7eb8 |
children | e1c586b9a43c |
rev | line source |
---|---|
34397 | 1 from __future__ import absolute_import, division, print_function |
2 | |
3 | |
4 __all__ = ["set_run_validators", "get_run_validators"] | |
5 | |
6 _run_validators = True | |
7 | |
8 | |
9 def set_run_validators(run): | |
10 """ | |
11 Set whether or not validators are run. By default, they are run. | |
12 """ | |
13 if not isinstance(run, bool): | |
14 raise TypeError("'run' must be bool.") | |
15 global _run_validators | |
16 _run_validators = run | |
17 | |
18 | |
19 def get_run_validators(): | |
20 """ | |
21 Return whether or not validators are run. | |
22 """ | |
23 return _run_validators |