import posixpath
import sys
from errno import *
-from glob import _StringGlobber, _no_recurse_symlinks
from itertools import chain
from stat import (
S_IMODE, S_ISDIR, S_ISREG, S_ISLNK, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO,
)
from _collections_abc import Sequence
+lazy import shutil
+lazy from glob import _StringGlobber, _no_recurse_symlinks
try:
import pwd
if self.is_symlink() or self.is_junction():
self.unlink()
elif self.is_dir():
- # Lazy import to improve module import time
- import shutil
shutil.rmtree(self)
else:
self.unlink()
class LazyImportTest(unittest.TestCase):
@cpython_only
def test_lazy_import(self):
- import_helper.ensure_lazy_imports("pathlib", {"shutil"})
+ import_helper.ensure_lazy_imports("pathlib", {"glob", "shutil"})
#