minor refactoring

git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@340 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
jvr 2002-09-12 16:45:48 +00:00
parent 1e7014865e
commit 52966bb144
2 changed files with 7 additions and 7 deletions

View File

@ -392,9 +392,8 @@ class BaseTable:
raise # XXX on KeyError, raise nice error
value = conv.xmlRead(attrs, content, font)
if conv.repeat:
try:
seq = getattr(self, conv.name)
except AttributeError:
seq = getattr(self, conv.name, None)
if seq is None:
seq = []
setattr(self, conv.name, seq)
seq.append(value)

View File

@ -142,10 +142,11 @@ class Struct(BaseConverter):
if Format is not None:
table.Format = int(Format)
for element in content:
if type(element) <> TupleType:
continue
if type(element) == TupleType:
name, attrs, content = element
table.fromXML((name, attrs, content), font)
else:
pass
return table