Skip to content

Commit

Permalink
Prepend third_party/pyyaml to python sys.path (#54023)
Browse files Browse the repository at this point in the history
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: #54001

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
cbracken authored Jul 22, 2024
1 parent 1aab6f8 commit ceb452f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/fuchsia/dart/gen_dart_package_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion tools/pub_get_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))))
Expand Down

0 comments on commit ceb452f

Please sign in to comment.