Open package.xml, not the directory.

This commit is contained in:
Jelmer Vernooij 2021-04-06 00:13:57 +01:00
parent 72b9fe6f54
commit ac553e1ae9

View file

@ -175,12 +175,13 @@ class Pear(BuildSystem):
@classmethod @classmethod
def probe(cls, path): def probe(cls, path):
if not os.path.exists(os.path.join(path, "package.xml")): package_xml_path = os.path.join(path, "package.xml")
if not os.path.exists(package_xml_path):
return return
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
try: try:
tree = ET.iterparse(path) tree = ET.iterparse(package_xml_path)
except ET.ParseError as e: except ET.ParseError as e:
logging.warning("Unable to parse package.xml: %s", e) logging.warning("Unable to parse package.xml: %s", e)
return return