Skip to content

Commit cb87828

Browse files
don't complain if it's the same exact option
1 parent 3b6cfa0 commit cb87828

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

schemascii/data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ class Data:
5656
@classmethod
5757
def define_option(cls, ns: str, opt: _dc.Option):
5858
if ns in cls.allowed_options:
59-
if any(eo.name == opt.name for eo in cls.allowed_options[ns]):
59+
if any(eo.name == opt.name and eo != opt
60+
for eo in cls.allowed_options[ns]):
6061
raise ValueError(f"duplicate option name {opt.name!r}")
61-
cls.allowed_options[ns].append(opt)
62+
if opt not in cls.allowed_options[ns]:
63+
cls.allowed_options[ns].append(opt)
6264
else:
6365
cls.allowed_options[ns] = [opt]
6466

0 commit comments

Comments
 (0)