python: better support for Python 3
* wrap/python/spot.i (spot::ltl::parse_error_list, spot::tgba_parse_error_list): Add a __bool__ method, that is used instead of __nonzero__ in Python 3. * wrap/python/tests/interdep.py, wrap/python/tests/parsetgba.py: Force destruction order. * NEWS: Update.
This commit is contained in:
parent
a6714119f9
commit
b6e5ce7e15
4 changed files with 28 additions and 6 deletions
4
NEWS
4
NEWS
|
|
@ -1,6 +1,8 @@
|
||||||
New in spot 1.2.2a (not yet released)
|
New in spot 1.2.2a (not yet released)
|
||||||
|
|
||||||
Nothing yet.
|
* Bug fixes:
|
||||||
|
|
||||||
|
- More fixes for Python 3 compatibility.
|
||||||
|
|
||||||
New in spot 1.2.2 (2014-01-24)
|
New in spot 1.2.2 (2014-01-24)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche
|
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||||
// et Développement de l'Epita (LRDE).
|
// Recherche et Développement de l'Epita (LRDE).
|
||||||
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique
|
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique
|
||||||
// de Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
// de Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
// Université Pierre et Marie Curie.
|
// Université Pierre et Marie Curie.
|
||||||
|
|
@ -457,6 +457,12 @@ __nonzero__()
|
||||||
return !self->empty();
|
return !self->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
__bool__()
|
||||||
|
{
|
||||||
|
return !self->empty();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%extend spot::tgba_parse_error_list {
|
%extend spot::tgba_parse_error_list {
|
||||||
|
|
@ -467,4 +473,10 @@ __nonzero__()
|
||||||
return !self->empty();
|
return !self->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
__bool__()
|
||||||
|
{
|
||||||
|
return !self->empty();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- mode: python; coding: utf-8 -*-
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
# Copyright (C) 2010, 2012 Laboratoire de Recherche et Développement
|
# Copyright (C) 2010, 2012, 2014 Laboratoire de Recherche et
|
||||||
# de l'EPITA.
|
# Développement de l'EPITA.
|
||||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6
|
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6
|
||||||
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
|
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
|
||||||
# Pierre et Marie Curie.
|
# Pierre et Marie Curie.
|
||||||
|
|
@ -42,3 +42,7 @@ while not iter.done():
|
||||||
# it means buddy can grok spot's objects.
|
# it means buddy can grok spot's objects.
|
||||||
iter.next()
|
iter.next()
|
||||||
sys.stdout.write("%s\n" % b)
|
sys.stdout.write("%s\n" % b)
|
||||||
|
del b
|
||||||
|
del c
|
||||||
|
del f
|
||||||
|
del a
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- mode: python; coding: utf-8 -*-
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
# Copyright (C) 2012 Laboratoire de Recherche et Développement
|
# Copyright (C) 2012, 2014 Laboratoire de Recherche et Développement
|
||||||
# de l'Epita (LRDE).
|
# de l'Epita (LRDE).
|
||||||
#
|
#
|
||||||
# This file is part of Spot, a model checking library.
|
# This file is part of Spot, a model checking library.
|
||||||
|
|
@ -41,4 +41,8 @@ assert not p
|
||||||
|
|
||||||
spot.dotty_reachable(spot.get_cout(), a)
|
spot.dotty_reachable(spot.get_cout(), a)
|
||||||
|
|
||||||
|
del p
|
||||||
|
del a
|
||||||
|
del d
|
||||||
|
|
||||||
os.unlink(filename)
|
os.unlink(filename)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue