Fix the other 2 python scripts that generates license. (#12340)

Fixes YAML.load_all issues on two of the Python scripts that generate license.

The broken Python files interfere with some of the Maven tasks.
This commit is contained in:
Didip Kerabat 2022-04-08 04:13:17 -07:00 committed by GitHub
parent d98cbd90f0
commit df48e446b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -137,7 +137,7 @@ def generate_license(apache_license_v2, license_yaml):
# Print Apache license first. # Print Apache license first.
print_outfile(apache_license_v2) print_outfile(apache_license_v2)
with open(license_yaml, encoding='utf-8') as registry_file: with open(license_yaml, encoding='utf-8') as registry_file:
licenses_list = list(yaml.load_all(registry_file)) licenses_list = list(yaml.load_all(registry_file, Loader=yaml.Loader))
# Group licenses by license_name, license_category, and then module. # Group licenses by license_name, license_category, and then module.
licenses_map = {} licenses_map = {}

View File

@ -57,7 +57,7 @@ def generate_notice(source_notice, dependences_yaml):
# Print Apache license first. # Print Apache license first.
print_outfile(source_notice) print_outfile(source_notice)
with open(dependences_yaml, encoding='utf-8') as registry_file: with open(dependences_yaml, encoding='utf-8') as registry_file:
dependencies = list(yaml.load_all(registry_file)) dependencies = list(yaml.load_all(registry_file, Loader=yaml.Loader))
# Group dependencies by module # Group dependencies by module
modules_map = defaultdict(list) modules_map = defaultdict(list)