mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-08 00:06:51 -05:00
avoid bare 'except'
This commit is contained in:
parent
12f012eb20
commit
90521e660d
@ -130,7 +130,7 @@ class Grass7Utils:
|
|||||||
if line.startswith("7."):
|
if line.startswith("7."):
|
||||||
Grass7Utils.version = line
|
Grass7Utils.version = line
|
||||||
return Grass7Utils.version
|
return Grass7Utils.version
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return None
|
return None
|
||||||
@ -398,7 +398,7 @@ class Grass7Utils:
|
|||||||
if 'GRASS_INFO_PERCENT' in line:
|
if 'GRASS_INFO_PERCENT' in line:
|
||||||
try:
|
try:
|
||||||
feedback.setProgress(int(line[len('GRASS_INFO_PERCENT') + 2:]))
|
feedback.setProgress(int(line[len('GRASS_INFO_PERCENT') + 2:]))
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if 'r.out' in line or 'v.out' in line:
|
if 'r.out' in line or 'v.out' in line:
|
||||||
@ -449,7 +449,7 @@ class Grass7Utils:
|
|||||||
try:
|
try:
|
||||||
feedback.setProgress(int(
|
feedback.setProgress(int(
|
||||||
line[len('GRASS_INFO_PERCENT') + 2:]))
|
line[len('GRASS_INFO_PERCENT') + 2:]))
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
if any(l in line for l in ['WARNING', 'ERROR']):
|
if any(l in line for l in ['WARNING', 'ERROR']):
|
||||||
loglines.append(line.strip())
|
loglines.append(line.strip())
|
||||||
|
|||||||
@ -158,7 +158,7 @@ class OtbParameterChoice(QgsProcessingParameterDefinition):
|
|||||||
if default is not None:
|
if default is not None:
|
||||||
try:
|
try:
|
||||||
self.default = int(default)
|
self.default = int(default)
|
||||||
except:
|
except Exception:
|
||||||
self.default = 0
|
self.default = 0
|
||||||
self.value = self.default
|
self.value = self.default
|
||||||
|
|
||||||
|
|||||||
@ -187,7 +187,7 @@ class OtbUtils:
|
|||||||
if int(percent) >= 100:
|
if int(percent) >= 100:
|
||||||
feedback.pushConsoleInfo(line)
|
feedback.pushConsoleInfo(line)
|
||||||
feedback.setProgress(int(percent))
|
feedback.setProgress(int(percent))
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if feedback is None:
|
if feedback is None:
|
||||||
|
|||||||
@ -153,7 +153,7 @@ def getInstalledVersion(runSaga=False):
|
|||||||
return None
|
return None
|
||||||
except IOError:
|
except IOError:
|
||||||
retries += 1
|
retries += 1
|
||||||
except:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return _installedVersion
|
return _installedVersion
|
||||||
@ -186,14 +186,14 @@ def executeSaga(feedback):
|
|||||||
s = ''.join(x for x in line if x.isdigit())
|
s = ''.join(x for x in line if x.isdigit())
|
||||||
try:
|
try:
|
||||||
feedback.setProgress(int(s))
|
feedback.setProgress(int(s))
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line not in ['/', '-', '\\', '|']:
|
if line not in ['/', '-', '\\', '|']:
|
||||||
loglines.append(line)
|
loglines.append(line)
|
||||||
feedback.pushConsoleInfo(line)
|
feedback.pushConsoleInfo(line)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if ProcessingConfig.getSetting(SAGA_LOG_CONSOLE):
|
if ProcessingConfig.getSetting(SAGA_LOG_CONSOLE):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user