##// END OF EJS Templates
registrar: raise a programming error on duplicated registering...
Pierre-Yves David -
r30608:b52e8a4f default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from . import (
10 from . import (
11 error,
11 pycompat,
12 pycompat,
12 util,
13 util,
13 )
14 )
@@ -50,6 +51,10 b' class _funcregistrarbase(object):'
50 def _doregister(self, func, decl, *args, **kwargs):
51 def _doregister(self, func, decl, *args, **kwargs):
51 name = self._getname(decl)
52 name = self._getname(decl)
52
53
54 if name in self._table:
55 msg = 'duplicate registration for name: "%s"' % name
56 raise error.ProgrammingError(msg)
57
53 if func.__doc__ and not util.safehasattr(func, '_origdoc'):
58 if func.__doc__ and not util.safehasattr(func, '_origdoc'):
54 doc = func.__doc__.strip()
59 doc = func.__doc__.strip()
55 func._origdoc = doc
60 func._origdoc = doc
General Comments 0
You need to be logged in to leave comments. Login now