From 9ba0a794aac8a8d053b8552f1027203a7b3a3196 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Thu, 12 Apr 2018 18:34:51 +0200 Subject: [PATCH] [file_utils] fix python shebang & run prospector prospector is still complaining about bare excepts in unln.py. --- file_utils/dirpacker.py | 6 +++--- file_utils/unln.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/file_utils/dirpacker.py b/file_utils/dirpacker.py index 1c06ca4..11d9b5f 100755 --- a/file_utils/dirpacker.py +++ b/file_utils/dirpacker.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # dirpacker.py, Copyright © 2014 Matteo Cypriani # @@ -119,7 +119,7 @@ def create_bin(binnumber): files[sizes[size].pop()] = size # Delete the size from the dictionary if its last file name was just # popped: - if not len(sizes[size]): + if not sizes[size]: del sizes[size] binsize = newbinsize @@ -194,7 +194,7 @@ if options.verbose: bins = [] binnumber = options.first_bin_number binscreated = 0 -while len(sizes): +while sizes: bins.append(create_bin(binnumber)) binnumber += 1 binscreated += 1 diff --git a/file_utils/unln.py b/file_utils/unln.py index fecccfe..6ae37aa 100755 --- a/file_utils/unln.py +++ b/file_utils/unln.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # unln.py, Copyright © 2013 Matteo Cypriani # @@ -177,6 +177,6 @@ for filename in options.filenames: # Display the list of files in error -if len(error_filenames): +if error_filenames: warn("The following regular files still have more than one hard link:") print(*error_filenames, sep="\n", file=sys.stderr)