diff options
Diffstat (limited to 'scripts/pythondeps')
-rwxr-xr-x | scripts/pythondeps | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/pythondeps b/scripts/pythondeps index 590b9769e7..48277ec28a 100755 --- a/scripts/pythondeps +++ b/scripts/pythondeps @@ -1,5 +1,9 @@ #!/usr/bin/env python3 # +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: GPL-2.0-only +# # Determine dependencies of python scripts or available python modules in a search path. # # Given the -d argument and a filename/filenames, returns the modules imported by those files. @@ -9,7 +13,8 @@ import argparse import ast -import imp +import importlib +from importlib import machinery import logging import os.path import sys @@ -17,10 +22,7 @@ import sys logger = logging.getLogger('pythondeps') -suffixes = [] -for triple in imp.get_suffixes(): - suffixes.append(triple[0]) - +suffixes = importlib.machinery.all_suffixes() class PythonDepError(Exception): pass |