python: make sere twa::acc() survives its automaton
Fixes #468. * python/spot/__init__.py: Add wrapper around twa::acc() and twa::get_acceptance() to store the automaton into the acceptance proxy, therefore ensuring that the automaton survives that proxy. * tests/python/setacc.py: Test it.
This commit is contained in:
parent
b767411a82
commit
d019ea61fe
2 changed files with 35 additions and 1 deletions
|
|
@ -96,3 +96,13 @@ except RuntimeError as e:
|
|||
pass
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
||||
# issue #468
|
||||
from gc import collect
|
||||
acc = spot.translate('a').acc()
|
||||
collect()
|
||||
assert acc == spot.acc_cond('Inf(0)')
|
||||
acc = spot.translate('b').get_acceptance()
|
||||
collect()
|
||||
assert acc == spot.acc_code('Inf(0)')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue