blob: 97f54f9b4606ee71111d0518a5a21f1d097daad3 [file] [log] [blame]
Chih-Hung Hsieh7cc0e152021-04-26 17:09:36 -07001#!/usr/bin/env python3
Chih-Hung Hsieh888d1432019-12-09 19:32:03 -08002#
3# Copyright (C) 2019 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Marco Nelissen594375d2009-07-14 09:04:04 -070016
Chih-Hung Hsieh888d1432019-12-09 19:32:03 -080017"""Call -m warn.warn to process warning messages.
Chih-Hung Hsieh6c0fdbb2016-09-26 10:56:43 -070018
Chih-Hung Hsieh888d1432019-12-09 19:32:03 -080019This script is used by Android continuous build bots for all branches.
20Old frozen branches will continue to use the old warn.py, and active
21branches will use this new version to call -m warn.warn.
Chih-Hung Hsieh6c0fdbb2016-09-26 10:56:43 -070022"""
23
Chih-Hung Hsieha45c5c12016-10-11 15:30:26 -070024import os
Chih-Hung Hsieh888d1432019-12-09 19:32:03 -080025import subprocess
Chih-Hung Hsieh76d00652016-11-09 18:19:05 -080026import sys
Marco Nelissen594375d2009-07-14 09:04:04 -070027
Chih-Hung Hsieh6c0fdbb2016-09-26 10:56:43 -070028
Meike Baumgärtnerac9d5df2016-09-28 10:48:06 -070029def main():
Chih-Hung Hsieh98b285d2021-04-28 14:49:32 -070030 """Old main() calls warn.warn."""
Chih-Hung Hsieh888d1432019-12-09 19:32:03 -080031 os.environ['PYTHONPATH'] = os.path.dirname(os.path.abspath(__file__))
Chih-Hung Hsieh7cc0e152021-04-26 17:09:36 -070032 subprocess.check_call(['/usr/bin/python3', '-m', 'warn.warn'] + sys.argv[1:])
Chih-Hung Hsieh2a38c372016-09-22 19:22:07 -070033
Meike Baumgärtnerac9d5df2016-09-28 10:48:06 -070034
Meike Baumgärtnerac9d5df2016-09-28 10:48:06 -070035if __name__ == '__main__':
36 main()