deep listdir works in python3 on windows · precommit/pre-commit@5706b91 · GitHub
Skip to content

Commit 5706b91

Browse files
committed
deep listdir works in python3 on windows
1 parent 5779f93 commit 5706b91

3 files changed

Lines changed: 4 additions & 30 deletions

File tree

pre_commit/languages/node.py

Lines changed: 4 additions & 4 deletions

testing/util.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import contextlib
22
import os.path
33
import subprocess
4-
import sys
54

65
import pytest
76

@@ -46,27 +45,6 @@ def cmd_output_mocked_pre_commit_home(
4645
xfailif_windows = pytest.mark.xfail(os.name == 'nt', reason='windows')
4746

4847

49-
def broken_deep_listdir(): # pragma: no cover (platform specific)
50-
if sys.platform != 'win32':
51-
return False
52-
try:
53-
os.listdir('\\\\?\\' + os.path.abspath('.'))
54-
except OSError:
55-
return True
56-
try:
57-
os.listdir(b'\\\\?\\C:' + b'\\' * 300)
58-
except TypeError:
59-
return True
60-
except OSError:
61-
return False
62-
63-
64-
xfailif_broken_deep_listdir = pytest.mark.xfail(
65-
broken_deep_listdir(),
66-
reason='Node on windows requires deep listdir',
67-
)
68-
69-
7048
xfailif_no_symlink = pytest.mark.xfail(
7149
not hasattr(os, 'symlink'),
7250
reason='Symlink is not supported on this platform',

tests/repository_test.py

Lines changed: 0 additions & 4 deletions

0 commit comments

Comments
 (0)