From edbaf57bd47e2952d3e79999b6ee9beef6614825 Mon Sep 17 00:00:00 2001 From: hanpfei Date: Wed, 20 Apr 2022 10:14:45 +0800 Subject: [PATCH] Fix a dead loop in tools_webrtc/libs/generate_licenses.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:13975 Signed-off-by: hanpfei Change-Id: I3943f66b1a80e3f1e4b05f4436dbeff23f3d6285 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259280 Reviewed-by: Jeremy Leconte Reviewed-by: Kári Helgason Reviewed-by: Christoffer Jansson Reviewed-by: Jeremy Leconte Commit-Queue: Jeremy Leconte Cr-Commit-Position: refs/heads/main@{#36596} --- AUTHORS | 1 + tools_webrtc/libs/generate_licenses.py | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6c6a0cd017..d9ec369020 100644 --- a/AUTHORS +++ b/AUTHORS @@ -120,6 +120,7 @@ Yaowen Guo Yura Yaroshevich Yuriy Pavlyshak Yusuke Suzuki +Pengfei Han # END individuals section. # BEGIN organizations section. diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py index 644bea1902..d8054770c3 100755 --- a/tools_webrtc/libs/generate_licenses.py +++ b/tools_webrtc/libs/generate_licenses.py @@ -100,17 +100,9 @@ LIB_REGEX_TO_LICENSES_DICT = { } -def FindSrcDirPath(): - """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])) +SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) 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')) import find_depot_tools