laforge has submitted this change. (
https://gerrit.osmocom.org/c/python/pyosmocom/+/41383?usp=email )
Change subject: Fix lint errors: do not use bare except
......................................................................
Fix lint errors: do not use bare except
src/osmocom/construct.py:90:9: E722 Do not use bare `except`
|
88 | ad = GsmString(GreedyBytes)
89 | return ad._encode(obj, context, path)
90 | except:
| ^^^^^^ E722
91 | ad = Ucs2Adapter(GreedyBytes)
92 | return ad._encode(obj, context, path)
Change-Id: Ia5fe852b6d990ad728fc3dedc7012c8fced92e13
---
M src/osmocom/construct.py
M src/osmocom/utils.py
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
fixeria: Looks good to me, approved
diff --git a/src/osmocom/construct.py b/src/osmocom/construct.py
index 693f365..d369bc7 100644
--- a/src/osmocom/construct.py
+++ b/src/osmocom/construct.py
@@ -89,7 +89,7 @@
try:
ad = GsmString(GreedyBytes)
return ad._encode(obj, context, path)
- except:
+ except Exception:
ad = Ucs2Adapter(GreedyBytes)
return ad._encode(obj, context, path)
diff --git a/src/osmocom/utils.py b/src/osmocom/utils.py
index 347bb93..3991da2 100644
--- a/src/osmocom/utils.py
+++ b/src/osmocom/utils.py
@@ -209,7 +209,7 @@
try:
_try_encode = h2b(string)
return True
- except:
+ except Exception:
return False
#########################################################################
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41383?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ia5fe852b6d990ad728fc3dedc7012c8fced92e13
Gerrit-Change-Number: 41383
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>