zhongjiajie commented on a change in pull request #5112:
[WIP][AIRFLOW-4209][AIP3-STEP13] Replace imp by importlib
URL: https://github.com/apache/airflow/pull/5112#discussion_r294578483
##########
File path: airflow/plugins_manager.py
##########
@@ -137,8 +140,12 @@ def is_valid_plugin(plugin_obj, existing_plugins):
# normalize root path as namespace
namespace = '_'.join([re.sub(norm_pattern, '__', root), mod_name])
- m = imp.load_source(namespace, filepath)
- for obj in list(m.__dict__.values()):
+ spec = importlib.util.spec_from_file_location(namespace, filepath)
+ mod = importlib.util.module_from_spec(spec)
+ # get rid of mypy errors
+ assert isinstance(spec.loader, Loader)
Review comment:
Thanks, fix it
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services