Skip to content

Commit

Permalink
Add exist_ok=True to all makedirs
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Oct 1, 2024
1 parent ee1a032 commit 383ae44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def build_generation(args: argparse.Namespace, mg: MonoGen) -> None:
return

logger.info(f'Building monobase generation {mg.id}...')
os.makedirs(gdir)
os.makedirs(gdir, exist_ok=True)

for k, v in mg.cuda.items():
src = install_cuda(args, v)
Expand Down Expand Up @@ -72,7 +72,7 @@ def build_generation(args: argparse.Namespace, mg: MonoGen) -> None:


def build(args: argparse.Namespace) -> None:
os.makedirs(args.cache)
os.makedirs(args.cache, exist_ok=True)

for mg in MONOGENS[args.environment]:
if mg.id < args.min_gen_id or mg.id > args.max_gen_id:
Expand Down
2 changes: 1 addition & 1 deletion src/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def install_cudnn(args: argparse.Namespace, version: str, cuda_major: str) -> st
subprocess.run(cmd, check=True)

logger.info(f'Installing CuDNN {key}...')
os.makedirs(cdir)
os.makedirs(cdir, exist_ok=True)
cmd = ['tar', '-xf', file, '--strip-components=1', '--exclude=lib*.a', '-C', cdir]
subprocess.run(cmd, check=True)
os.remove(file)
Expand Down

0 comments on commit 383ae44

Please sign in to comment.