importlib -> imp for < 2.7 compatibility
This commit is contained in:
parent
c72da6c0b9
commit
b5d2f74636
|
@ -30,7 +30,7 @@ import re
|
||||||
import signal
|
import signal
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from importlib import import_module
|
import imp
|
||||||
|
|
||||||
# Used for bound_interface
|
# Used for bound_interface
|
||||||
socket_socket = socket.socket
|
socket_socket = socket.socket
|
||||||
|
@ -673,7 +673,8 @@ def speedtest():
|
||||||
if args.resultlog:
|
if args.resultlog:
|
||||||
logmodule = None
|
logmodule = None
|
||||||
try:
|
try:
|
||||||
logmodule = import_module(args.resultlog)
|
found = imp.find_module(args.resultlog)
|
||||||
|
logmodule = imp.load_module(args.resultlog, found)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print_('Load log module (%s) failed.' % args.resultlog),
|
print_('Load log module (%s) failed.' % args.resultlog),
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in New Issue