Fix a dead loop in tools_webrtc/libs/generate_licenses.py

Bug: webrtc:13975
Signed-off-by: hanpfei <hanpfei@gmail.com>
Change-Id: I3943f66b1a80e3f1e4b05f4436dbeff23f3d6285
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259280
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#36596}
This commit is contained in:
hanpfei 2022-04-20 10:14:45 +08:00 committed by WebRTC LUCI CQ
parent 4587852740
commit edbaf57bd4
2 changed files with 3 additions and 10 deletions

View File

@ -120,6 +120,7 @@ Yaowen Guo <albertguo88@gmail.com>
Yura Yaroshevich <yura.yaroshevich@gmail.com> Yura Yaroshevich <yura.yaroshevich@gmail.com>
Yuriy Pavlyshak <yuriy@appear.in> Yuriy Pavlyshak <yuriy@appear.in>
Yusuke Suzuki <utatane.tea@gmail.com> Yusuke Suzuki <utatane.tea@gmail.com>
Pengfei Han <hanpfei@gmail.com>
# END individuals section. # END individuals section.
# BEGIN organizations section. # BEGIN organizations section.

View File

@ -100,17 +100,9 @@ LIB_REGEX_TO_LICENSES_DICT = {
} }
def FindSrcDirPath(): SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
"""Returns the abs path to the src/ dir of the project."""
src_dir = os.path.dirname(os.path.abspath(__file__))
while os.path.basename(src_dir) != 'src':
src_dir = os.path.normpath(os.path.join(src_dir, os.pardir))
return src_dir
SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
WEBRTC_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir)) WEBRTC_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir))
SRC_DIR = FindSrcDirPath() SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
sys.path.append(os.path.join(SRC_DIR, 'build')) sys.path.append(os.path.join(SRC_DIR, 'build'))
import find_depot_tools import find_depot_tools