_postproc_translate_options: fix syntax error
* python/spot/__init__.py: Here. * tests/python/except.py: Add test. * NEWS: Mention the issue.
This commit is contained in:
parent
71f1f2fb96
commit
09bb61db33
3 changed files with 16 additions and 3 deletions
4
NEWS
4
NEWS
|
|
@ -92,6 +92,10 @@ New in spot 2.8.5.dev (not yet released)
|
|||
consequence, some correct output could be larger than necessary
|
||||
(but still correct).
|
||||
|
||||
- calling spot.translate() with two conflicting preferences like
|
||||
spot.translate(..., 'det', 'any') triggered a syntax error in the
|
||||
Python code to handle this error.
|
||||
|
||||
New in spot 2.8.5 (2020-01-04)
|
||||
|
||||
Bugs fixed:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2019 Laboratoire de
|
||||
# Copyright (C) 2014-2020 Laboratoire de
|
||||
# Recherche et Développement de l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -622,7 +622,7 @@ def _postproc_translate_options(obj, default_type, *args):
|
|||
nonlocal pref_, pref_name_
|
||||
if pref_ is not None and pref_name_ != val:
|
||||
raise ValueError("preference cannot be both {} and {}"
|
||||
.format(pref_name, val))
|
||||
.format(pref_name_, val))
|
||||
elif val == 'small':
|
||||
pref_ = postprocessor.Small
|
||||
elif val == 'deterministic':
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2018, 2019 Laboratoire de Recherche et Développement de
|
||||
# Copyright (C) 2018-2020 Laboratoire de Recherche et Développement de
|
||||
# l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -179,3 +179,12 @@ except RuntimeError as e:
|
|||
assert "requires a semi-deterministic input" in str(e)
|
||||
else:
|
||||
report_missing_exception()
|
||||
|
||||
try:
|
||||
spot.translate('F(G(a | !a) & ((b <-> c) W d))', 'det', 'any')
|
||||
except ValueError as e:
|
||||
s = str(e)
|
||||
assert 'det' in s
|
||||
assert 'any' in s
|
||||
else:
|
||||
report_missing_exception()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue