struct: fix exception in StructProxy

This commit is contained in:
Shiz 2021-06-25 01:55:41 +02:00
parent 6a4cdae3a1
commit 7ee5d565bc
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ class StructProxy:
def __getattr__(self, name: str) -> VarExpr:
e = VarExpr(name)
self._sx_fields_[name].append(e)
try:
self._sx_fields_[name].append(e)
except KeyError:
raise AttributeError(name) from None
return e