Fix pylint: do not use bare 'except' (#5025)
* Fix E722, do not use bare 'except' * Remove used codes * Add FileNotFoundError in LoadImagesAndLabels * Remove AssertionError * Ignore LoadImagesAndLabels * Ignore downloads.py * Ignore torch_utils.py * Ignore train.py * Ignore datasets.py * Enable utils/download.py * Fixing exception in thop * Remove unused code * Fixing exception in LoadImagesAndLabels * Fixing exception in exif_size * Fixing exception in parse_model * Ignore exceptions in requests * Revert the exception as suggested * Revert the exception as suggested
This commit is contained in:
1 parent
b0ade48457
commit
1922ddeac0
4 files changed
+7
-7
No files matched your search
+1
-1
@@ -268,7 +268,7 @@ def parse_model(d, ch, model, imgsz): # model_dict, input_channels(3)
|
||||
for j, a in enumerate(args):
|
||||
try:
|
||||
args[j] = eval(a) if isinstance(a, str) else a # eval strings
|
||||
except:
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
n = max(round(n * gd), 1) if n > 1 else n # depth gain
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ def parse_model(d, ch): # model_dict, input_channels(3)
|
||||
for j, a in enumerate(args):
|
||||
try:
|
||||
args[j] = eval(a) if isinstance(a, str) else a # eval strings
|
||||
except:
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
n = n_ = max(round(n * gd), 1) if n > 1 else n # depth gain
|
||||
|
||||
Reference in new issue
Block a user