File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ def _norm(path):
6868def _get_default_version (): # pragma: no cover (platform dependent)
6969 # First attempt from `sys.executable` (or the realpath)
7070 exe = _find_by_sys_executable ()
71+ if exe :
72+ return exe
7173
7274 # Next try the `pythonX.X` executable
7375 exe = 'python{}.{}' .format (* sys .version_info )
Original file line number Diff line number Diff line change 77import mock
88import pytest
99
10- import pre_commit . parse_shebang
10+ from pre_commit import parse_shebang
1111from pre_commit .languages import python
1212
1313
@@ -50,7 +50,7 @@ def mocked_find_executable(exe):
5050 with mock .patch .object (sys , 'executable' , exe ):
5151 with mock .patch .object (os .path , 'realpath' , return_value = realpath ):
5252 with mock .patch .object (
53- pre_commit . parse_shebang , 'find_executable' ,
53+ parse_shebang , 'find_executable' ,
5454 side_effect = mocked_find_executable ,
5555 ):
5656 assert python ._find_by_sys_executable () == expected
You can’t perform that action at this time.
0 commit comments