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
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique
|
||||
// de Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
|
|
@ -457,6 +457,12 @@ __nonzero__()
|
|||
return !self->empty();
|
||||
}
|
||||
|
||||
bool
|
||||
__bool__()
|
||||
{
|
||||
return !self->empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
%extend spot::tgba_parse_error_list {
|
||||
|
|
@ -467,4 +473,10 @@ __nonzero__()
|
|||
return !self->empty();
|
||||
}
|
||||
|
||||
bool
|
||||
__bool__()
|
||||
{
|
||||
return !self->empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue