##// END OF EJS Templates
typing: add pseudo localstr.__init__() to help pytype...
typing: add pseudo localstr.__init__() to help pytype Apparently, pytype failed to parse localstr.__new__()? This fixes the following errors: line 126, in __hash__: No attribute '_utf8' on localstr [attribute-error] line 188, in tolocal: Function localstr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, string: str, ...) Actually passed: (self, string: bytes, ...)

File last commit:

r43979:9e1932eb default
r44080:da925257 default
Show More
__init__.py
14 lines | 431 B | text/x-python | PythonLexer
revlog: introduce an explicit NodeMap class for pure code...
r43924 # mercurial.revlogutils -- basic utilities for revlog
#
# Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from .. import error
class NodeMap(dict):
def __missing__(self, x):
nodemap: use bytes for the error message...
r43979 raise error.RevlogError(b'unknown node: %s' % x)