Merge pull request #14988 from brave/issues/25208
Fix python override helpers to not conflict with Chromium codebase.
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
|
||||
index 8663125b048a4222f1a024ee0b50e4d6c059cfb0..bddf023a8fb18696e89b8d020298e104103364ae 100644
|
||||
index 8663125b048a4222f1a024ee0b50e4d6c059cfb0..4388ea7cd43614dc55a88feb3154ffcdb3113aef 100644
|
||||
--- a/PRESUBMIT.py
|
||||
+++ b/PRESUBMIT.py
|
||||
@@ -6032,7 +6032,6 @@ def CheckPythonShebang(input_api, output_api):
|
||||
file))
|
||||
return result
|
||||
|
||||
-
|
||||
def CheckBatchAnnotation(input_api, output_api):
|
||||
"""Checks that tests have either @Batch or @DoNotBatch annotation. If this
|
||||
is not an instrumentation test, disregard."""
|
||||
@@ -6095,3 +6094,5 @@ Robolectric tests do not need a @Batch or @DoNotBatch annotations.
|
||||
@@ -6095,3 +6095,4 @@ Robolectric tests do not need a @Batch or @DoNotBatch annotations.
|
||||
""", extra_annotation_errors))
|
||||
|
||||
return results
|
||||
+
|
||||
+if not globals().get('__name__'): from lib.import_inline import inline_module; inline_module('chromium_presubmit_overrides', globals(), locals())
|
||||
+from import_inline import inline_module; inline_module('chromium_presubmit_overrides', globals(), locals())
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import copy
|
||||
|
||||
import lib.chromium_presubmit_utils as chromium_presubmit_utils
|
||||
import lib.override_utils as override_utils
|
||||
import override_utils
|
||||
|
||||
_BRAVE_DEFAULT_FILES_TO_SKIP = (r'win_build_output[\\/].*', )
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@ import os.path
|
||||
|
||||
def _find_src_dir():
|
||||
"""Searches for src/ dir which includes brave/ dir."""
|
||||
path = os.getcwd()
|
||||
current_file = globals().get('__file__')
|
||||
if current_file and os.path.isabs(current_file):
|
||||
path = os.path.dirname(current_file)
|
||||
else:
|
||||
path = os.getcwd()
|
||||
while True:
|
||||
if os.path.basename(path) == 'src' and os.path.isdir(
|
||||
os.path.join(path, 'brave')):
|
||||
@@ -3,7 +3,7 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import lib.override_utils as override_utils
|
||||
import override_utils
|
||||
|
||||
|
||||
def override_check(scope, name=None):
|
||||
|
||||
Reference in New Issue
Block a user