diff --git a/pyext/ctools/__init__.py.in b/pyext/ctools/__init__.py.in index 6973fa3..e6c4661 100755 --- a/pyext/ctools/__init__.py.in +++ b/pyext/ctools/__init__.py.in @@ -1,7 +1,7 @@ # ========================================================================== # ctools Python module # -# Copyright (C) 2015-2016 Juergen Knoedlseder +# Copyright (C) 2015-2021 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,14 +26,15 @@ from @PYTHON_RELATIVE_IMPORT@tools import * # Remove swig register stuff bad_entries = [entry for entry in list(locals()) if entry.endswith('_swigregister')] -for entry in bad_entries: - del locals()[entry] +if len(bad_entries) > 0: + for entry in bad_entries: + del locals()[entry] + del entry # Clean-up del tools del gammalib del bad_entries -del entry # Add version __version__ = '@PACKAGE_VERSION@'