osmith has uploaded this change for review. (
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(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom
refs/changes/83/41383/1
diff --git a/src/osmocom/construct.py b/src/osmocom/construct.py
index d312e07..643f314 100644
--- a/src/osmocom/construct.py
+++ b/src/osmocom/construct.py
@@ -87,7 +87,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: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ia5fe852b6d990ad728fc3dedc7012c8fced92e13
Gerrit-Change-Number: 41383
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>