summaryrefslogtreecommitdiffstats
path: root/scripts/pythondeps
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-15 15:04:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-29 23:50:43 +0100
commita872c9619288744f55da64ebf599434053594238 (patch)
tree38de2004f3abde8e57fa7560ce24aa97aebfa082 /scripts/pythondeps
parent4d63da3fad18264688debf0c3bce4b9d562c9d82 (diff)
downloadpoky-a872c9619288744f55da64ebf599434053594238.tar.gz
scripts: Remove deprecated imp module usage
The imp module is deprecated, port the code over to use importlib as recently done for bb.utils as well. (From OE-Core rev: f3ba6cee5927c7475c3dc47658fa0548aec52115) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/pythondeps')
-rwxr-xr-xscripts/pythondeps8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/pythondeps b/scripts/pythondeps
index 590b9769e7..3e13a587ee 100755
--- a/scripts/pythondeps
+++ b/scripts/pythondeps
@@ -9,7 +9,8 @@
9 9
10import argparse 10import argparse
11import ast 11import ast
12import imp 12import importlib
13from importlib import machinery
13import logging 14import logging
14import os.path 15import os.path
15import sys 16import sys
@@ -17,10 +18,7 @@ import sys
17 18
18logger = logging.getLogger('pythondeps') 19logger = logging.getLogger('pythondeps')
19 20
20suffixes = [] 21suffixes = importlib.machinery.all_suffixes()
21for triple in imp.get_suffixes():
22 suffixes.append(triple[0])
23
24 22
25class PythonDepError(Exception): 23class PythonDepError(Exception):
26 pass 24 pass