You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/06/18 01:26:15 UTC
[GitHub] [airflow] zhongjiajie commented on a change in pull request #5112:
[WIP][AIRFLOW-4209][AIP3-STEP13] Replace imp by importlib
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:
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:
users@infra.apache.org
With regards,
Apache Git Services