Skip to content

Commit e42a7fd

Browse files
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 <module> if not importlib.util.find_spec("six"): ^^^^^^^^^^^^^^ AttributeError: module 'importlib' has no attribute 'util' ```
1 parent 3900ec9 commit e42a7fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

bin/ma5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This is the main executable, a simple frontend to set up the PYTHONPATH
3333
and call immediately the command line interface scripts
3434
"""
3535

36-
import importlib
36+
from importlib import util
3737
import os
3838
import sys
3939

@@ -48,7 +48,7 @@ if sys.version_info[0] != 3 or sys.version_info[1] <= 6:
4848
)
4949

5050
# Checking that the 'six' package is present
51-
if not importlib.util.find_spec("six"):
51+
if not util.find_spec("six"):
5252
sys.exit(
5353
'The python "six" module is not found on your system and it is required for MadAnalysis 5 for '
5454
+ "a question of Python 2/3 compatibility. Please install it with the following command:\n"

doc/releases/changelog-dev.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
## Bug fixes
88

9+
* Add missing `importlib.util` import.
10+
([#278](https://github.com/MadAnalysis/madanalysis5/pull/278))
11+
912
## Contributors
1013

1114
This release contains contributions from (in alphabetical order):

0 commit comments

Comments
 (0)