Replace deprecated imp module with importlib
parent
9b7d64daac
commit
e716729ad7
4
phenny
4
phenny
|
@ -12,9 +12,9 @@ Then run ./phenny again
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import imp
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
from textwrap import dedent as trim
|
from textwrap import dedent as trim
|
||||||
|
|
||||||
dotdir = os.path.expanduser('~/.phenny')
|
dotdir = os.path.expanduser('~/.phenny')
|
||||||
|
@ -152,7 +152,7 @@ def main(argv=None):
|
||||||
config_modules = []
|
config_modules = []
|
||||||
for config_name in config_names(args.config):
|
for config_name in config_names(args.config):
|
||||||
name = os.path.basename(config_name).split('.')[0] + '_config'
|
name = os.path.basename(config_name).split('.')[0] + '_config'
|
||||||
module = imp.load_source(name, config_name)
|
module = SourceFileLoader(name, config_name).load_module()
|
||||||
module.filename = config_name
|
module.filename = config_name
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
Loading…
Reference in New Issue