| #!/usr/bin/env python3 |
| # -*- coding: utf-8 -*- |
| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| """Wrapper to run pylint with the right sys.path.""" |
| |
| from __future__ import print_function |
| |
| import os |
| import sys |
| |
| import ssh_client |
| import libdot |
| |
| |
| def main(argv): |
| """The main func!""" |
| env = os.environ.copy() |
| pythonpath = ':'.join([libdot.BIN_DIR, ssh_client.BIN_DIR]) |
| if 'PYTHONPATH' in env: |
| pythonpath = '%s:%s' % (pythonpath, env['PYTHONPATH']) |
| env['PYTHONPATH'] = pythonpath |
| |
| pylint = os.path.join(libdot.BIN_DIR, 'pylint') |
| os.execve(pylint, [pylint] + argv, env) |
| |
| |
| if __name__ == '__main__': |
| sys.exit(main(sys.argv[1:])) |