importlib -> imp for < 2.7 compatibility

This commit is contained in:
bk2zsto 2014-05-09 21:03:13 -04:00
parent c72da6c0b9
commit b5d2f74636
1 changed files with 3 additions and 2 deletions

View File

@ -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)