Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avoid bare 'except'
  • Loading branch information
alexbruy committed Jun 21, 2021
1 parent 12f012e commit 90521e6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions python/plugins/grassprovider/Grass7Utils.py
Expand Up @@ -130,7 +130,7 @@ def installedVersion(run=False):
if line.startswith("7."):
Grass7Utils.version = line
return Grass7Utils.version
except:
except Exception:
pass

return None
Expand Down Expand Up @@ -398,7 +398,7 @@ def executeGrass(commands, feedback, outputCommands=None):
if 'GRASS_INFO_PERCENT' in line:
try:
feedback.setProgress(int(line[len('GRASS_INFO_PERCENT') + 2:]))
except:
except Exception:
pass
else:
if 'r.out' in line or 'v.out' in line:
Expand Down Expand Up @@ -449,7 +449,7 @@ def executeGrass(commands, feedback, outputCommands=None):
try:
feedback.setProgress(int(
line[len('GRASS_INFO_PERCENT') + 2:]))
except:
except Exception:
pass
if any(l in line for l in ['WARNING', 'ERROR']):
loglines.append(line.strip())
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/otbprovider/OtbChoiceWidget.py
Expand Up @@ -158,7 +158,7 @@ def __init__(self, name='', description='', options=[], default=None, isSource=F
if default is not None:
try:
self.default = int(default)
except:
except Exception:
self.default = 0
self.value = self.default

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/otbprovider/OtbUtils.py
Expand Up @@ -187,7 +187,7 @@ def executeOtb(commands, feedback, addToLog=True):
if int(percent) >= 100:
feedback.pushConsoleInfo(line)
feedback.setProgress(int(percent))
except:
except Exception:
pass
else:
if feedback is None:
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/sagaprovider/SagaUtils.py
Expand Up @@ -153,7 +153,7 @@ def getInstalledVersion(runSaga=False):
return None
except IOError:
retries += 1
except:
except Exception:
return None

return _installedVersion
Expand Down Expand Up @@ -186,14 +186,14 @@ def executeSaga(feedback):
s = ''.join(x for x in line if x.isdigit())
try:
feedback.setProgress(int(s))
except:
except Exception:
pass
else:
line = line.strip()
if line not in ['/', '-', '\\', '|']:
loglines.append(line)
feedback.pushConsoleInfo(line)
except:
except Exception:
pass

if ProcessingConfig.getSetting(SAGA_LOG_CONSOLE):
Expand Down

0 comments on commit 90521e6

Please sign in to comment.