Prepend third_party/pyyaml to python sys.path (flutter/engine#54023)
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 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -15,7 +15,7 @@ import re
|
||||
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'
|
||||
|
||||
@@ -15,7 +15,7 @@ import subprocess
|
||||
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__))))
|
||||
|
||||
Reference in New Issue
Block a user