shutil: Don't allow an empty string in rmtree.

pull/574/head
Brian Pugh 2022-11-10 08:17:26 -08:00 zatwierdzone przez Damien George
rodzic 4ae896afdc
commit 69e8a502dd
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -1,3 +1,3 @@
metadata(version="0.0.4")
metadata(version="0.0.5")
module("shutil.py")

Wyświetl plik

@ -6,6 +6,9 @@ _ntuple_diskusage = namedtuple("usage", ("total", "used", "free"))
def rmtree(d):
if not d:
raise ValueError
for name, type, *_ in os.ilistdir(d):
path = d + "/" + name
if type & 0x4000: # dir