From bcd88df0fe767a39d3e04d495491921b0d1c3da1 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 8 Nov 2020 12:04:55 +0100 Subject: [PATCH] python: rename aux.py to aux_.py Fixes #437, reporeted by Yann Thierry-Mieg. * python/spot/aux.py: Rename as... * python/spot/aux_.py: ... this. * python/spot/__init__.py, python/Makefile.am: Adjust. * NEWS: Mention the change. --- NEWS | 6 +++++- python/Makefile.am | 2 +- python/spot/__init__.py | 6 ++++++ python/spot/{aux.py => aux_.py} | 7 +++++-- 4 files changed, 17 insertions(+), 4 deletions(-) rename python/spot/{aux.py => aux_.py} (93%) diff --git a/NEWS b/NEWS index 35a8b0d11..7c34cf502 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ New in spot 2.9.4.dev (not yet released) - Nothing yet. + Bugs fixed: + + - The filename python/spot/aux.py caused a problem on Windows and + has been renamed. Existing "import spot.aux" statements should + *not* be updated. (Issue #437.) New in spot 2.9.4 (2020-09-07) diff --git a/python/Makefile.am b/python/Makefile.am index 00a176531..e3fbac6de 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -30,7 +30,7 @@ SWIGFLAGS = -c++ -python -py3 -O -MD EXTRA_DIST = buddy.i spot/impl.i spot/ltsmin.i spot/gen.i nobase_pyexec_PYTHON = \ spot/__init__.py \ - spot/aux.py \ + spot/aux_.py \ spot/impl.py \ spot/ltsmin.py \ spot/gen.py \ diff --git a/python/spot/__init__.py b/python/spot/__init__.py index a3f0c3b57..88d2ed9d3 100644 --- a/python/spot/__init__.py +++ b/python/spot/__init__.py @@ -47,6 +47,12 @@ for path in sys.path: from spot.impl import * +# spot.aux_ used to be called spot.aux until the filename aux.py +# caused issues on Windows. So the file is now named aux_.py, but we +# still want to import it as spot.aux, hence we add it to spot.modules +# as an alias. +import spot.aux_ as aux +sys.modules['spot.aux'] = aux from spot.aux import \ extend as _extend, \ str_to_svg as _str_to_svg, \ diff --git a/python/spot/aux.py b/python/spot/aux_.py similarity index 93% rename from python/spot/aux.py rename to python/spot/aux_.py index cd56d212b..3c6435296 100644 --- a/python/spot/aux.py +++ b/python/spot/aux_.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016, 2019 Laboratoire de Recherche et Développement de l'Epita -# (LRDE). +# Copyright (C) 2016, 2019-2020 Laboratoire de Recherche et +# Développement de l'Epita (LRDE). # # This file is part of Spot, a model checking library. # @@ -17,6 +17,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# This file is named "aux_.py" for compatibility with Windows' +# historical limitations, but should really be imported as "spot.aux". + """ Auxiliary functions for Spot's Python bindings """