##// END OF EJS Templates
util: use tryunlink in unlinkpath...
Ryan McElroy -
r31541:bd9daafb default
parent child Browse files
Show More
@@ -1606,11 +1606,10 b' class atomictempfile(object):'
1606
1606
1607 def unlinkpath(f, ignoremissing=False):
1607 def unlinkpath(f, ignoremissing=False):
1608 """unlink and remove the directory if it is empty"""
1608 """unlink and remove the directory if it is empty"""
1609 try:
1609 if ignoremissing:
1610 tryunlink(f)
1611 else:
1610 unlink(f)
1612 unlink(f)
1611 except OSError as e:
1612 if not (ignoremissing and e.errno == errno.ENOENT):
1613 raise
1614 # try removing directories that might now be empty
1613 # try removing directories that might now be empty
1615 try:
1614 try:
1616 removedirs(os.path.dirname(f))
1615 removedirs(os.path.dirname(f))
General Comments 0
You need to be logged in to leave comments. Login now