comparison mercurial/registrar.py @ 42596:83666f011679

py3: store _origdoc as str Since __doc__ is str, it seems natural that _origdoc also is. Differential Revision: https://phab.mercurial-scm.org/D6623
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 09 Jul 2019 00:03:10 -0700
parents de65ae32b82d
children 2372284d9457
comparison
equal deleted inserted replaced
42595:819712deac69 42596:83666f011679
62 if name in self._table: 62 if name in self._table:
63 msg = 'duplicate registration for name: "%s"' % name 63 msg = 'duplicate registration for name: "%s"' % name
64 raise error.ProgrammingError(msg) 64 raise error.ProgrammingError(msg)
65 65
66 if func.__doc__ and not util.safehasattr(func, '_origdoc'): 66 if func.__doc__ and not util.safehasattr(func, '_origdoc'):
67 doc = pycompat.sysbytes(func.__doc__).strip() 67 func._origdoc = func.__doc__.strip()
68 func._origdoc = doc 68 doc = pycompat.sysbytes(func._origdoc)
69 func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc)) 69 func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc))
70 70
71 self._table[name] = func 71 self._table[name] = func
72 self._extrasetup(name, func, *args, **kwargs) 72 self._extrasetup(name, func, *args, **kwargs)
73 73