|
@@ -722,8 +722,8 @@ def prune_suffix(var, suffixes, d):
|
|
|
# See if var ends with any of the suffixes listed and
|
|
|
# remove it if found
|
|
|
for suffix in suffixes:
|
|
|
- if var.endswith(suffix):
|
|
|
- return var.replace(suffix, "")
|
|
|
+ if suffix and var.endswith(suffix):
|
|
|
+ return var[:-len(suffix)]
|
|
|
return var
|
|
|
|
|
|
def mkdirhier(directory):
|