equal
deleted
inserted
replaced
63 |
63 |
64 if name in self._table: |
64 if name in self._table: |
65 msg = b'duplicate registration for name: "%s"' % name |
65 msg = b'duplicate registration for name: "%s"' % name |
66 raise error.ProgrammingError(msg) |
66 raise error.ProgrammingError(msg) |
67 |
67 |
68 if func.__doc__ and not util.safehasattr(func, b'_origdoc'): |
68 if func.__doc__ and not util.safehasattr(func, '_origdoc'): |
69 func._origdoc = func.__doc__.strip() |
69 func._origdoc = func.__doc__.strip() |
70 doc = pycompat.sysbytes(func._origdoc) |
70 doc = pycompat.sysbytes(func._origdoc) |
71 func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc)) |
71 func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc)) |
72 |
72 |
73 self._table[name] = func |
73 self._table[name] = func |