From f1ddb0817eeb98ec8389f8457109fbf63bc1898b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 28 Jan 2020 19:34:33 -0800 Subject: [PATCH] Convert to Path objects before checking same-drive req. Otherwise, passing "." fails. Oops. --- hash_hardlink.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hash_hardlink.py b/hash_hardlink.py index 2627191..d3ed98c 100644 --- a/hash_hardlink.py +++ b/hash_hardlink.py @@ -3,6 +3,7 @@ import os import send2trash import sys +from voussoirkit import pathclass from voussoirkit import spinal def hash_file(file): @@ -16,8 +17,9 @@ def hash_file(file): return hasher.hexdigest() def main(argv): - folders = argv - drives = set(os.path.splitdrive(folder)[0] for folder in folders) + folders = [pathclass.Path(p) for p in argv] + + drives = set(os.path.splitdrive(folder.absolute_path)[0] for folder in folders) if len(drives) != 1: raise ValueError('All paths must be on the same drive.')