Method: pylint.lint.expand_modules.get_python_path
Calls: 3398, Exceptions: 0, Paths: 4Back
Path 1: 1967 calls (0.58)
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/config/file_to_lint.py' (150) '/Users/andrehora/Documents/git/projects-pathspotter/p...
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/regrtest_data' (336) '/Users/andrehora/Documents/git/projects-pathspotter/pylint/tes...
1def get_python_path(filepath: str) -> str:
2 """TODO This get the python path with the (bad) assumption that there is always
3 an __init__.py.
4
5 This is not true since python 3.3 and is causing problem.
6 """
7 dirname = os.path.realpath(os.path.expanduser(filepath))
8 if not os.path.isdir(dirname):
9 dirname = os.path.dirname(dirname)
10 while True:
11 if not os.path.exists(os.path.join(dirname, "__init__.py")):
12 return dirname
13 old_dirname = dirname
14 dirname = os.path.dirname(dirname)
15 if old_dirname == dirname:
16 return os.getcwd()
Path 2: 1259 calls (0.37)
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/functional/t/too/too_many_branches.py' (15) '/Users/andrehora/Documents/git/projects...
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests' (1221) '/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/regrtest_d...
1def get_python_path(filepath: str) -> str:
2 """TODO This get the python path with the (bad) assumption that there is always
3 an __init__.py.
4
5 This is not true since python 3.3 and is causing problem.
6 """
7 dirname = os.path.realpath(os.path.expanduser(filepath))
8 if not os.path.isdir(dirname):
9 dirname = os.path.dirname(dirname)
10 while True:
11 if not os.path.exists(os.path.join(dirname, "__init__.py")):
12 return dirname
13 old_dirname = dirname
14 dirname = os.path.dirname(dirname)
15 if old_dirname == dirname:
16 return os.getcwd()
Path 3: 152 calls (0.04)
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/lint/../regrtest_data/directory/package' (24) '/Users/andrehora/Documents/git/projec...
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/regrtest_data/directory' (45) '/Users/andrehora/Documents/git/projects-pathspotter/p...
1def get_python_path(filepath: str) -> str:
2 """TODO This get the python path with the (bad) assumption that there is always
3 an __init__.py.
4
5 This is not true since python 3.3 and is causing problem.
6 """
7 dirname = os.path.realpath(os.path.expanduser(filepath))
8 if not os.path.isdir(dirname):
9 dirname = os.path.dirname(dirname)
10 while True:
11 if not os.path.exists(os.path.join(dirname, "__init__.py")):
12 return dirname
13 old_dirname = dirname
14 dirname = os.path.dirname(dirname)
15 if old_dirname == dirname:
16 return os.getcwd()
Path 4: 20 calls (0.01)
'a' (5) '/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/checkers/../regrtest_data/beyond_top_two' (3) '/Users/andrehora/Documents/gi...
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/regrtest_data/beyond_top_two' (3) '/Users/andrehora/Documents/git/projects-pathspott...
1def get_python_path(filepath: str) -> str:
2 """TODO This get the python path with the (bad) assumption that there is always
3 an __init__.py.
4
5 This is not true since python 3.3 and is causing problem.
6 """
7 dirname = os.path.realpath(os.path.expanduser(filepath))
8 if not os.path.isdir(dirname):
9 dirname = os.path.dirname(dirname)
10 while True:
11 if not os.path.exists(os.path.join(dirname, "__init__.py")):
12 return dirname
13 old_dirname = dirname
14 dirname = os.path.dirname(dirname)
15 if old_dirname == dirname:
16 return os.getcwd()