Merge pull request #2714 from fonttools/NotANone
[varLib.merge] fix NameError: 'NotANone'
This commit is contained in:
commit
cf00320403
@ -120,6 +120,20 @@ class FoundANone(VarLibMergeError):
|
||||
return f"{stack[0]}=={cause['got']}\n"
|
||||
|
||||
|
||||
class NotANone(VarLibMergeError):
|
||||
"""one of the values in a list was not empty when it should have been"""
|
||||
|
||||
@property
|
||||
def offender(self):
|
||||
index = [x is not None for x in self.cause["got"]].index(True)
|
||||
return index, self._master_name(index)
|
||||
|
||||
@property
|
||||
def details(self):
|
||||
cause, stack = self.cause, self.stack
|
||||
return f"{stack[0]}=={cause['got']}\n"
|
||||
|
||||
|
||||
class MismatchedTypes(VarLibMergeError):
|
||||
"""data had inconsistent types"""
|
||||
|
||||
|
@ -31,6 +31,7 @@ from .errors import (
|
||||
ShouldBeConstant,
|
||||
FoundANone,
|
||||
MismatchedTypes,
|
||||
NotANone,
|
||||
LengthsDiffer,
|
||||
KeysDiffer,
|
||||
InconsistentGlyphOrder,
|
||||
|
Loading…
x
Reference in New Issue
Block a user