Commit 79469dae authored by Grégory Wisniewski's avatar Grégory Wisniewski

Avoid shadow previous 'register' method definition.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1845 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e12bb81f
......@@ -1408,7 +1408,7 @@ class PacketRegistry(dict):
# build a "singleton"
Packets = PacketRegistry()
def register(code):
def register_error(code):
def wrapper(registry, message=''):
return Error(code, message)
return wrapper
......@@ -1421,12 +1421,12 @@ class ErrorRegistry(dict):
def __init__(self):
dict.__init__(self)
Ack = register(ErrorCodes.ACK)
ProtocolError = register(ErrorCodes.PROTOCOL_ERROR)
TidNotFound = register(ErrorCodes.TID_NOT_FOUND)
OidNotFound = register(ErrorCodes.OID_NOT_FOUND)
NotReady = register(ErrorCodes.NOT_READY)
Broken = register(ErrorCodes.BROKEN_NODE)
Ack = register_error(ErrorCodes.ACK)
ProtocolError = register_error(ErrorCodes.PROTOCOL_ERROR)
TidNotFound = register_error(ErrorCodes.TID_NOT_FOUND)
OidNotFound = register_error(ErrorCodes.OID_NOT_FOUND)
NotReady = register_error(ErrorCodes.NOT_READY)
Broken = register_error(ErrorCodes.BROKEN_NODE)
Errors = ErrorRegistry()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment