Skip to content

Commit 51486a2

Browse files
committed
Fix lint: ruff E722
1 parent 27f9a88 commit 51486a2

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

bins/svc/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def preprocess(cfg, args):
101101
new_datasets_list.extend(new_datasets)
102102
cfg.dataset.extend(new_datasets_list)
103103
print("Augmentation datasets: ", cfg.dataset)
104-
except:
104+
except Exception: # TODO: better exception handling
105105
print("No Data Augmentation.")
106106

107107
# Dump metadata of datasets (singers, train/test durations, etc.)

bins/tta/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def preprocess(cfg, args):
108108
new_datasets_list.extend(new_datasets)
109109
cfg.dataset.extend(new_datasets_list)
110110
print("Augmentation datasets: ", cfg.dataset)
111-
except:
111+
except Exception: # TODO: better exception handling
112112
print("No Data Augmentation.")
113113

114114
# Dump metadata of datasets (singers, train/test durations, etc.)

bins/tts/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def preprocess(cfg, args):
134134
new_datasets_list.extend(new_datasets)
135135
cfg.dataset.extend(new_datasets_list)
136136
print("Augmentation datasets: ", cfg.dataset)
137-
except:
137+
except Exception: # TODO: better exception handling
138138
print("No Data Augmentation.")
139139

140140
# json files

bins/vocoder/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def preprocess(cfg, args):
7878
new_datasets_list.extend(new_datasets)
7979
cfg.dataset.extend(new_datasets_list)
8080
print("Augmentation datasets: ", cfg.dataset)
81-
except:
81+
except Exception: # TODO: better exception handling
8282
print("No Data Augmentation.")
8383

8484
# Dump metadata of datasets (singers, train/test durations, etc.)

evaluation/metrics/similarity/speaker_similarity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def extract_similarity(path_ref, path_deg, **kwargs):
108108
"microsoft/wavlm-base-plus-sv"
109109
)
110110
model = WavLMForXVector.from_pretrained("microsoft/wavlm-base-plus-sv")
111-
except:
111+
except Exception: # TODO: better exception handling
112112
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(
113113
"pretrained/wavlm", sampling_rate=16000
114114
)

models/svc/base/svc_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def __getitem__(self, index):
481481
if self.trans_key:
482482
try:
483483
self.trans_key = int(self.trans_key)
484-
except:
484+
except Exception: # TODO: better exception handling
485485
pass
486486
if isinstance(self.trans_key, int):
487487
frame_pitch = transpose_key(frame_pitch, self.trans_key)

processors/content_extractor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def offline_resolution_transformation(self, content, target_len):
129129
try:
130130
with open(err_log_dir, "r") as f:
131131
err_num = int(f.read())
132-
except:
132+
except Exception: # TODO: better exception handling
133133
with open(err_log_dir, "w") as f:
134134
f.write("0")
135135
err_num = 0
@@ -154,7 +154,7 @@ def log_for_ReTrans(self, err):
154154
try:
155155
with open(err_log_dir, "r") as f:
156156
err_num = int(f.read())
157-
except:
157+
except Exception: # TODO: better exception handling
158158
with open(err_log_dir, "w") as f:
159159
f.write("0")
160160
err_num = 0

utils/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
try:
2222
from ruamel.yaml import YAML as yaml
23-
except:
23+
except ImportError:
2424
from ruamel_yaml import YAML as yaml
2525

2626
import torch

0 commit comments

Comments
 (0)