Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jrapin committed Feb 10, 2021
1 parent 8d973f3 commit 0685afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nevergrad/common/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def register_name(
self, name: str, obj: X, info: tp.Optional[tp.Dict[tp.Hashable, tp.Any]] = None
) -> None:
"""Register an object with a provided name"""
# if name in self:
# raise RuntimeError(f'Encountered a name collision "{name}"')
if name in self:
raise RuntimeError(f'Encountered a name collision "{name}"')
self[name] = obj
if info is not None:
assert isinstance(info, dict)
Expand Down

0 comments on commit 0685afe

Please sign in to comment.