Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def support_can_symlink():
return pathlib.supports_symlinks
support.rmtree = shutil.rmtree
try:
import grp
import pwd
except ImportError:
grp = pwd = None
# support.can_symlink is missing prior to Python 3
if six.PY2:
def support_can_symlink():
return pathlib.supports_symlinks
support_skip_unless_symlink = unittest.skipIf(
not pathlib.supports_symlinks,
"symlinks not supported on this platform")
else:
support_can_symlink = support.can_symlink
support_skip_unless_symlink = support.skip_unless_symlink
# Backported from 3.4
def fs_is_case_insensitive(directory):
"""Detects if the file system for the specified directory is
case-insensitive.
"""
base_fp, base_path = tempfile.mkstemp(dir=directory)
case_path = base_path.upper()
if case_path == base_path:
case_path = base_path.lower()
try: