We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b50bcec commit 397fd95Copy full SHA for 397fd95
qubes/storage/reflink.py
@@ -369,15 +369,17 @@ def _replace_file(dst):
369
qubes.utils.remove_file, log_level=logging.INFO)
370
371
def _make_dir(path):
372
- ''' mkdir path, ignoring FileExistsError; return whether we
373
- created it.
374
- '''
375
- with suppress(FileExistsError):
+ try:
+ created = False
376
os.mkdir(path)
+ created = True
+ except FileExistsError:
377
+ if not os.path.isdir(path):
378
+ raise
379
+ if created:
380
qubes.utils.fsync_path(os.path.dirname(path))
381
LOGGER.info('Created directory: %r', path)
- return True
- return False
382
+ return created
383
384
def _remove_empty_dir(path):
385
try:
0 commit comments