##// END OF EJS Templates
typing: add a fake `__init__()` to bytestr to distract pytype...
typing: add a fake `__init__()` to bytestr to distract pytype I'm not sure what changed before pytype 09-09-2021 (from 04-15-2021), but these started getting flagged. This wrapping an exception in a `bytestr` pattern has been flagged before, and I've fixed it then with `stringutil.forcebytestr()`. But that doesn't work here, because it would create a circular import. I suspect the issue is `bytes.__new__()` wants `Iterable[int]`, so it just assumes the subclass will also take that. The referenced pytype bug isn't an exact match, but seems related and the suggested workaround helps. The specific warnings fixed are: File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 212, in tolocal: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: LookupError) Attributes of protocol Iterable[int] are not implemented on LookupError: __iter__ Called from (traceback): line 353, in current file File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 240, in fromlocal: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: UnicodeDecodeError) Attributes of protocol Iterable[int] are not implemented on UnicodeDecodeError: __iter__ Differential Revision: https://phab.mercurial-scm.org/D11466

File last commit:

r48196:ebdef628 default
r48819:1fda8c93 default
Show More
Cargo.toml
22 lines | 427 B | text/plain | TOMLLexer
Antoine Cezar
rhg: add rhg crate...
r45503 [package]
name = "rhg"
version = "0.1.0"
Raphaël Gomès
rhg: use `format_bytes!` for error messages...
r46598 authors = [
"Antoine Cezar <antoine.cezar@octobus.net>",
"Raphaël Gomès <raphael.gomes@octobus.net>",
]
Antoine Cezar
rhg: add rhg crate...
r45503 edition = "2018"
[dependencies]
Antoine Cezar
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`...
r45592 hg-core = { path = "../hg-core"}
Simon Sapin
rhg: Add support for the blackbox extension...
r47343 chrono = "0.4.19"
Antoine Cezar
rhg: add a limited `rhg root` subcommand...
r45593 clap = "2.33.1"
Simon Sapin
rust: replace trivial `impl From …` with `#[derive(derive_more::From)]`...
r47164 derive_more = "0.99"
Pulkit Goyal
rhg: read [paths] for `--repository` value...
r48196 home = "0.5.3"
Simon Sapin
rhg: Fall back to Python on --repository with an URL...
r47463 lazy_static = "1.4.0"
Antoine Cezar
rhg: Add debug timing...
r46101 log = "0.4.11"
micro-timer = "0.3.1"
Simon Sapin
rhg: Fall back to Python on --repository with an URL...
r47463 regex = "1.3.9"
Antoine Cezar
rhg: Add debug timing...
r46101 env_logger = "0.7.1"
Simon Sapin
rhg: Fall back to Python if unsupported extensions are enabled...
r47467 format-bytes = "0.2.1"
Simon Sapin
rhg: Add support for the blackbox extension...
r47343 users = "0.11.0"