From afd79f4655534d092531fc2f6447bafc5afb54c1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Oct 2020 19:08:20 +0300 Subject: [PATCH] Improve initiating manifest parser from a package archive --- platformio/package/manifest/parser.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platformio/package/manifest/parser.py b/platformio/package/manifest/parser.py index b492bb79..4dd4476d 100644 --- a/platformio/package/manifest/parser.py +++ b/platformio/package/manifest/parser.py @@ -119,12 +119,13 @@ class ManifestParserFactory(object): assert path.endswith("tar.gz") with tarfile.open(path, mode="r:gz") as tf: for t in sorted(ManifestFileType.items().values()): - try: - return ManifestParserFactory.new( - tf.extractfile(t).read().decode(), t - ) - except KeyError: - pass + for member in (t, "./" + t): + try: + return ManifestParserFactory.new( + tf.extractfile(member).read().decode(), t + ) + except KeyError: + pass raise UnknownManifestError("Unknown manifest file type in %s archive" % path) @staticmethod