Skip to content

Commit

Permalink
commands: import importlib.util explicitly
Browse files Browse the repository at this point in the history
Python environments usually do not import importlib.util
unless asked to do so specifically:

>>> import importlib
>>> importlib.util
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'importlib' has no attribute 'util'

Therefore it would be better to import importlib.util explicitly.
Some commands (e.g. west zephyr-export) do not work on my setup
without that change.

Signed-off-by: Ilya Tagunov <[email protected]>
  • Loading branch information
tagunil authored and mbolivar-nordic committed Jan 26, 2021
1 parent 2c06baa commit fa7bba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/west/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,7 @@

from abc import ABC, abstractmethod
from collections import OrderedDict
import importlib
import importlib.util
import itertools
import os
from pathlib import Path
Expand Down

0 comments on commit fa7bba2

Please sign in to comment.