mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 01:22:00 +00:00
Switch to importlib for newer python
imp is deprecated, despite being much simpler, so use importlib in python3.6+ distributions.
This commit is contained in:
parent
942121d73a
commit
b32c343a0c
@ -3,9 +3,13 @@ try:
|
||||
except ImportError:
|
||||
import ConfigParser as configparser
|
||||
import cStringIO
|
||||
import imp
|
||||
import importlib.util
|
||||
import importlib.machinery
|
||||
import sys
|
||||
apiclient = imp.load_source('apiclient', '/opt/confluent/bin/apiclient')
|
||||
modloader = importlib.machinery.SourceFileLoader('apiclient', '/opt/confluent/bin/apiclient')
|
||||
modspec = importlib.util.spec_from_file_location('apiclient', '/opt/confluent/bin/apiclient', loader=modloader)
|
||||
apiclient = importlib.util.module_from_spec(modspec)
|
||||
modspec.loader.exec_module(apiclient)
|
||||
repo = None
|
||||
server = None
|
||||
profile = None
|
||||
|
@ -3,9 +3,13 @@ try:
|
||||
except ImportError:
|
||||
import ConfigParser as configparser
|
||||
import cStringIO
|
||||
import imp
|
||||
import importlib.util
|
||||
import importlib.machinery
|
||||
import sys
|
||||
apiclient = imp.load_source('apiclient', '/opt/confluent/bin/apiclient')
|
||||
modloader = importlib.machinery.SourceFileLoader('apiclient', '/opt/confluent/bin/apiclient')
|
||||
modspec = importlib.util.spec_from_file_location('apiclient', '/opt/confluent/bin/apiclient', loader=modloader)
|
||||
apiclient = importlib.util.module_from_spec(modspec)
|
||||
modspec.loader.exec_module(apiclient)
|
||||
repo = None
|
||||
server = None
|
||||
profile = None
|
||||
|
Loading…
Reference in New Issue
Block a user