Merge "Fix _ImportParser() error if property is imported from oem partition." am: f774ae9aa0 am: 16402667c4

Change-Id: I9ad800b0f5aad55eac82c802cbb6b1b5a1926245
This commit is contained in:
Treehugger Robot 2020-05-15 01:18:06 +00:00 committed by Automerger Merge Worker
commit b05afb3207

View file

@ -803,8 +803,13 @@ class PartitionBuildProps(object):
"""Parses the build prop in a given import statement."""
tokens = line.split()
if len(tokens) != 2 or tokens[0] != 'import':
if tokens[0] != 'import' or (len(tokens) != 2 and len(tokens) != 3) :
raise ValueError('Unrecognized import statement {}'.format(line))
if len(tokens) == 3:
logger.info("Import %s from %s, skip", tokens[2], tokens[1])
return {}
import_path = tokens[1]
if not re.match(r'^/{}/.*\.prop$'.format(self.partition), import_path):
raise ValueError('Unrecognized import path {}'.format(line))