mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
os.rmdir() isn't reliable on windows
This commit is contained in:
parent
be494155cf
commit
108b2af944
@ -610,12 +610,9 @@ class AppRunner(DirectObject):
|
||||
files on Windows. It receives a Filename, the root directory
|
||||
to delete. """
|
||||
if filename.isDirectory():
|
||||
for child in os.listdir(filename.toOsSpecific()):
|
||||
for child in filename.scanDirectory():
|
||||
self.rmtree(Filename(filename, child))
|
||||
try:
|
||||
os.chmod(filename.toOsSpecific(), 777)
|
||||
os.rmdir(filename.toOsSpecific())
|
||||
except OSError:
|
||||
if not filename.rmdir():
|
||||
print "could not remove directory %s" % (filename)
|
||||
else:
|
||||
if not filename.unlink():
|
||||
|
Loading…
x
Reference in New Issue
Block a user