From f5d53e3a5e9e9f0ca740058466d97f5ce22f376f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 29 Mar 2017 11:56:11 +0200 Subject: [PATCH] python: update some incorrect or obsolete code * tests/python/ipnbdoctest.py: Use importlib instead of imp. * tests/python/ltlparse.py: Fix invalid escape sequence. --- tests/python/ipnbdoctest.py | 4 ++-- tests/python/ltlparse.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/python/ipnbdoctest.py b/tests/python/ipnbdoctest.py index d5c405c23..eb4256cf2 100755 --- a/tests/python/ipnbdoctest.py +++ b/tests/python/ipnbdoctest.py @@ -22,9 +22,9 @@ except ImportError: print('Python 3.x is needed to run this script.') sys.exit(77) -import imp +import importlib try: - imp.find_module('IPython') + importlib.util.find_spec('IPython') except: print('IPython is needed to run this script.') sys.exit(77) diff --git a/tests/python/ltlparse.py b/tests/python/ltlparse.py index 828ebda41..dd2368d64 100755 --- a/tests/python/ltlparse.py +++ b/tests/python/ltlparse.py @@ -25,7 +25,7 @@ import spot e = spot.default_environment.instance() -l = ['GFa', 'a U (((b)) xor c)', '!(FFx <=> Fx)', 'a \/ a \/ b \/ a \/ a']; +l = ['GFa', 'a U (((b)) xor c)', '!(FFx <=> Fx)', 'a \\/ a \\/ b \\/ a \\/ a'] for str1 in l: pf = spot.parse_infix_psl(str1, e, False)