From e42a7fd9a805284d6264e042d314e12b5bcb35d2 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Tue, 3 Dec 2024 11:00:34 -0700 Subject: [PATCH] fix: Add missing importlib.util import * Without first importing importlib.util an AttributeError will be raised ``` Traceback (most recent call last): File "/madanalysis5/./bin/ma5", line 51, in if not importlib.util.find_spec("six"): ^^^^^^^^^^^^^^ AttributeError: module 'importlib' has no attribute 'util' ``` --- bin/ma5 | 4 ++-- doc/releases/changelog-dev.md | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/ma5 b/bin/ma5 index a7974cf4..ad068352 100755 --- a/bin/ma5 +++ b/bin/ma5 @@ -33,7 +33,7 @@ This is the main executable, a simple frontend to set up the PYTHONPATH and call immediately the command line interface scripts """ -import importlib +from importlib import util import os import sys @@ -48,7 +48,7 @@ if sys.version_info[0] != 3 or sys.version_info[1] <= 6: ) # Checking that the 'six' package is present -if not importlib.util.find_spec("six"): +if not util.find_spec("six"): sys.exit( 'The python "six" module is not found on your system and it is required for MadAnalysis 5 for ' + "a question of Python 2/3 compatibility. Please install it with the following command:\n" diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index 9400eed3..7000c89c 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -6,6 +6,9 @@ ## Bug fixes +* Add missing `importlib.util` import. +([#278](https://github.com/MadAnalysis/madanalysis5/pull/278)) + ## Contributors This release contains contributions from (in alphabetical order):