diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/cython/Cython/Coverage.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Coverage.py')
-rw-r--r-- | contrib/tools/cython/Cython/Coverage.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/tools/cython/Cython/Coverage.py b/contrib/tools/cython/Cython/Coverage.py index 5aa9df2ce0..e699cfe4f4 100644 --- a/contrib/tools/cython/Cython/Coverage.py +++ b/contrib/tools/cython/Cython/Coverage.py @@ -33,14 +33,14 @@ def _find_c_source(base_path): return None -def _find_dep_file_path(main_file, file_path, relative_path_search=False): +def _find_dep_file_path(main_file, file_path, relative_path_search=False): abs_path = os.path.abspath(file_path) - if not os.path.exists(abs_path) and (file_path.endswith('.pxi') or - relative_path_search): - # files are looked up relative to the main source file - rel_file_path = os.path.join(os.path.dirname(main_file), file_path) - if os.path.exists(rel_file_path): - abs_path = os.path.abspath(rel_file_path) + if not os.path.exists(abs_path) and (file_path.endswith('.pxi') or + relative_path_search): + # files are looked up relative to the main source file + rel_file_path = os.path.join(os.path.dirname(main_file), file_path) + if os.path.exists(rel_file_path): + abs_path = os.path.abspath(rel_file_path) # search sys.path for external locations if a valid file hasn't been found if not os.path.exists(abs_path): for sys_path in sys.path: @@ -221,8 +221,8 @@ class Plugin(CoveragePlugin): self._c_files_map = {} for filename, code in code_lines.items(): - abs_path = _find_dep_file_path(c_file, filename, - relative_path_search=True) + abs_path = _find_dep_file_path(c_file, filename, + relative_path_search=True) self._c_files_map[abs_path] = (c_file, filename, code) if sourcefile not in self._c_files_map: |