From 70b5638d71bada43a20e340d5a114ab2f07b1a92 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 22 Jul 2024 09:47:35 -0700 Subject: [PATCH] Prepend third_party/pyyaml to python sys.path Previously we were appending Flutter's fork of third_party/pyyaml to the Python sys.path. In the case where a bot image or local install already has pyyaml installed elsewhere on the path, ours will fail to be picked up. Instead prepend to the path. Issue spotted by jsimmons@. Related: https://github.com/flutter/engine/pull/54001 --- tools/fuchsia/dart/gen_dart_package_config.py | 2 +- tools/pub_get_offline.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fuchsia/dart/gen_dart_package_config.py b/tools/fuchsia/dart/gen_dart_package_config.py index 71a8bb3666c91..d46ba0f8dafde 100755 --- a/tools/fuchsia/dart/gen_dart_package_config.py +++ b/tools/fuchsia/dart/gen_dart_package_config.py @@ -15,7 +15,7 @@ import sys THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -sys.path += [os.path.join(THIS_DIR, '..', '..', '..', 'third_party', 'pyyaml', 'lib')] +sys.path.insert(0, os.path.join(THIS_DIR, '..', '..', '..', 'third_party', 'pyyaml', 'lib')) import yaml DEFAULT_LANGUAGE_VERSION = '2.8' diff --git a/tools/pub_get_offline.py b/tools/pub_get_offline.py index 56e1d8d0d89a2..2195a676a7db6 100644 --- a/tools/pub_get_offline.py +++ b/tools/pub_get_offline.py @@ -15,7 +15,7 @@ import sys THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -sys.path += [os.path.join(THIS_DIR, '..', 'third_party', 'pyyaml', 'lib')] +sys.path.insert(0, os.path.join(THIS_DIR, '..', 'third_party', 'pyyaml', 'lib')) import yaml # pylint: disable=import-error, wrong-import-position SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))