Browse Source

[file_utils] fix python shebang & run prospector

prospector is still complaining about bare excepts in unln.py.
Matteo Cypriani 9 months ago
parent
commit
9ba0a794aa
2 changed files with 5 additions and 5 deletions
  1. 3
    3
      file_utils/dirpacker.py
  2. 2
    2
      file_utils/unln.py

+ 3
- 3
file_utils/dirpacker.py View File

@@ -1,4 +1,4 @@
1
-#!/usr/bin/python3
1
+#!/usr/bin/env python3
2 2
 #
3 3
 # dirpacker.py, Copyright © 2014 Matteo Cypriani <mcy@lm7.fr>
4 4
 #
@@ -119,7 +119,7 @@ def create_bin(binnumber):
119 119
         files[sizes[size].pop()] = size
120 120
         # Delete the size from the dictionary if its last file name was just
121 121
         # popped:
122
-        if not len(sizes[size]):
122
+        if not sizes[size]:
123 123
             del sizes[size]
124 124
 
125 125
         binsize = newbinsize
@@ -194,7 +194,7 @@ if options.verbose:
194 194
 bins = []
195 195
 binnumber = options.first_bin_number
196 196
 binscreated = 0
197
-while len(sizes):
197
+while sizes:
198 198
     bins.append(create_bin(binnumber))
199 199
     binnumber += 1
200 200
     binscreated += 1

+ 2
- 2
file_utils/unln.py View File

@@ -1,4 +1,4 @@
1
-#!/usr/bin/python3
1
+#!/usr/bin/env python3
2 2
 #
3 3
 # unln.py, Copyright © 2013 Matteo Cypriani <mcy@lm7.fr>
4 4
 #
@@ -177,6 +177,6 @@ for filename in options.filenames:
177 177
 
178 178
 
179 179
 # Display the list of files in error
180
-if len(error_filenames):
180
+if error_filenames:
181 181
     warn("The following regular files still have more than one hard link:")
182 182
     print(*error_filenames, sep="\n", file=sys.stderr)

Loading…
Cancel
Save