diff --git a/pre_commit/languages/helpers.py b/pre_commit/languages/helpers.py index 29138fd1..032e90c4 100644 --- a/pre_commit/languages/helpers.py +++ b/pre_commit/languages/helpers.py @@ -30,9 +30,10 @@ def exe_exists(exe: str) -> bool: if found is None: # exe exists return False + realpath = os.path.realpath(found) homedir = os.path.expanduser('~') try: - common: Optional[str] = os.path.commonpath((found, homedir)) + common: Optional[str] = os.path.commonpath((realpath, homedir)) except ValueError: # on windows, different drives raises ValueError common = None