equal
deleted
inserted
replaced
2608 removedirs(os.path.dirname(f)) |
2608 removedirs(os.path.dirname(f)) |
2609 except OSError: |
2609 except OSError: |
2610 pass |
2610 pass |
2611 |
2611 |
2612 |
2612 |
2613 def tryunlink(f: bytes) -> None: |
2613 def tryunlink(f: bytes) -> bool: |
2614 """Attempt to remove a file, ignoring FileNotFoundError.""" |
2614 """Attempt to remove a file, ignoring FileNotFoundError. |
|
2615 |
|
2616 Returns False in case the file did not exit, True otherwise |
|
2617 """ |
2615 try: |
2618 try: |
2616 unlink(f) |
2619 unlink(f) |
|
2620 return True |
2617 except FileNotFoundError: |
2621 except FileNotFoundError: |
2618 pass |
2622 return False |
2619 |
2623 |
2620 |
2624 |
2621 def makedirs( |
2625 def makedirs( |
2622 name: bytes, mode: Optional[int] = None, notindexed: bool = False |
2626 name: bytes, mode: Optional[int] = None, notindexed: bool = False |
2623 ) -> None: |
2627 ) -> None: |