From: Ralf Jung Date: Sun, 22 Sep 2013 08:39:28 +0000 (+0200) Subject: use importlib.machinery instead of the (deprecated) imp X-Git-Url: https://git.ralfj.de/mass-build.git/commitdiff_plain/b1a7ca874f864a9ddda2d97eaa188e1935d1300d?ds=inline;hp=8305e00803ac24b824091d634418a69294f0407a use importlib.machinery instead of the (deprecated) imp --- diff --git a/mass_build.py b/mass_build.py index e9e3725..88db907 100755 --- a/mass_build.py +++ b/mass_build.py @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import vcs, build_system, imp +import vcs, build_system, importlib.machinery import argparse, os, sys, subprocess from collections import OrderedDict @@ -81,7 +81,7 @@ if args.reset_source and not args.update: # load config old_val = sys.dont_write_bytecode sys.dont_write_bytecode = True -config = imp.load_source('config', args.config).__dict__ +config = importlib.machinery.SourceFileLoader('config', args.config).load_module().__dict__ sys.dont_write_bytecode = old_val # initialise variables holding the configuration