Skip to content
6 changes: 4 additions & 2 deletions Lib/pathlib/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import operator
import os
import posixpath
import shutil
import sys
from glob import _StringGlobber
from itertools import chain
Expand Down Expand Up @@ -824,7 +823,10 @@ def rmdir(self):
"""
os.rmdir(self)

_rmtree = shutil.rmtree
def _rmtree(self):
# Lazy import to improve module import time
import shutil
Comment thread
danielhollas marked this conversation as resolved.
Resolved
shutil.rmtree(self)

def rename(self, target):
"""
Expand Down