mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[ez] Use strip for arg sanitization in upload_metadata_file to improve readability (#144155)
Minor thing that improves readability. I didn't realize you could specify characters for strip when I wrote this Pull Request resolved: https://github.com/pytorch/pytorch/pull/144155 Approved by: https://github.com/huydhn, https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
8b3479e361
commit
383ff4011c
@ -35,12 +35,8 @@ def parse_args() -> argparse.Namespace:
|
||||
# slashes
|
||||
if args.bucket.startswith("s3://"):
|
||||
args.bucket = args.bucket[5:]
|
||||
if args.bucket.endswith("/"):
|
||||
args.bucket = args.bucket[:-1]
|
||||
if args.key_prefix.startswith("/"):
|
||||
args.key_prefix = args.key_prefix[1:]
|
||||
if args.key_prefix.endswith("/"):
|
||||
args.key_prefix = args.key_prefix[:-1]
|
||||
args.bucket = args.bucket.strip("/")
|
||||
args.key_prefix = args.key_prefix.strip("/")
|
||||
return args
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user