Change TypeError to ValueError
This commit is contained in:
parent
7c6337facf
commit
9712407054
@ -2575,7 +2575,7 @@ class ClassDefBuilder(object):
|
|||||||
self.classes_.add(glyphs)
|
self.classes_.add(glyphs)
|
||||||
for glyph in glyphs:
|
for glyph in glyphs:
|
||||||
if glyph in self.glyphs_:
|
if glyph in self.glyphs_:
|
||||||
raise TypeError(f"Glyph {glyph} already present in class.")
|
raise ValueError(f"Glyph {glyph} is already present in class.")
|
||||||
self.glyphs_[glyph] = glyphs
|
self.glyphs_[glyph] = glyphs
|
||||||
|
|
||||||
def classes(self):
|
def classes(self):
|
||||||
|
@ -1103,15 +1103,9 @@ class ClassDefBuilderTest(object):
|
|||||||
|
|
||||||
def test_add_exception(self):
|
def test_add_exception(self):
|
||||||
b = builder.ClassDefBuilder(useClass0=True)
|
b = builder.ClassDefBuilder(useClass0=True)
|
||||||
b.add({"a", "b", "c", "d"})
|
b.add({"a", "b", "c"})
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(ValueError):
|
||||||
b.add({"a"})
|
b.add({"a", "d"})
|
||||||
with pytest.raises(TypeError):
|
|
||||||
b.add({"b"})
|
|
||||||
with pytest.raises(TypeError):
|
|
||||||
b.add({"c"})
|
|
||||||
with pytest.raises(TypeError):
|
|
||||||
b.add({"d"})
|
|
||||||
|
|
||||||
|
|
||||||
buildStatTable_test_data = [
|
buildStatTable_test_data = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user