diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-15 15:04:02 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-16 11:46:07 +0000 |
| commit | dbe49d0ad197975e80c937e5e8da038d5c19e4c1 (patch) | |
| tree | 4e4d8cccd82990f32c6fefa7f1a0672ec4653da8 /scripts/pythondeps | |
| parent | f48d111e42398222e6ee8013a37ee35faf43ce09 (diff) | |
| download | poky-dbe49d0ad197975e80c937e5e8da038d5c19e4c1.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: 24809582d4850190d87cd8eb8180d0dce215dbdf)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/pythondeps')
| -rwxr-xr-x | scripts/pythondeps | 8 |
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 | ||
| 10 | import argparse | 10 | import argparse |
| 11 | import ast | 11 | import ast |
| 12 | import imp | 12 | import importlib |
| 13 | from importlib import machinery | ||
| 13 | import logging | 14 | import logging |
| 14 | import os.path | 15 | import os.path |
| 15 | import sys | 16 | import sys |
| @@ -17,10 +18,7 @@ import sys | |||
| 17 | 18 | ||
| 18 | logger = logging.getLogger('pythondeps') | 19 | logger = logging.getLogger('pythondeps') |
| 19 | 20 | ||
| 20 | suffixes = [] | 21 | suffixes = importlib.machinery.all_suffixes() |
| 21 | for triple in imp.get_suffixes(): | ||
| 22 | suffixes.append(triple[0]) | ||
| 23 | |||
| 24 | 22 | ||
| 25 | class PythonDepError(Exception): | 23 | class PythonDepError(Exception): |
| 26 | pass | 24 | pass |
