equal
deleted
inserted
replaced
1604 else: |
1604 else: |
1605 self.close() |
1605 self.close() |
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)) |
1617 except OSError: |
1616 except OSError: |
1618 pass |
1617 pass |