Skip to content

Commit 735ae64

Browse files
authored
General Exception is modified as built-in Exception
1 parent 51536a3 commit 735ae64

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

appqos/.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ min-public-methods=1
207207
[EXCEPTIONS]
208208

209209
# Exceptions that will emit a warning when caught.
210-
overgeneral-exceptions=Exception
210+
overgeneral-exceptions=builtins.Exception
211211

212212

213213
[FORMAT]

appqos/appqos/cache_ops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def rdt_interface():
544544
"""
545545
if cfg_rdt_iface != PQOS_API.current_iface():
546546
if PQOS_API.init(cfg_rdt_iface):
547-
raise Exception("Failed to initialize RDT interface!")
547+
raise RuntimeError("Failed to initialize RDT interface!")
548548

549549
log.info(f"RDT initialized with {cfg_rdt_iface.upper()} interface.")
550550
return True
@@ -615,11 +615,11 @@ def get_l3cdp_cfg():
615615
if PQOS_API.reset(l3_cdp_cfg = l3cdp_cfg, l2_cdp_cfg = l2cdp_cfg, \
616616
mba_cfg = mba_cfg):
617617
if l3cdp_cfg != "any":
618-
raise Exception("Failed to change L3 CDP state!")
618+
raise RuntimeError("Failed to change L3 CDP state!")
619619
if l2cdp_cfg != "any":
620-
raise Exception("Failed to change L2 CDP state!")
620+
raise RuntimeError("Failed to change L2 CDP state!")
621621
if mba_cfg != "any":
622-
raise Exception("Failed to change MBA BW state!")
622+
raise RuntimeError("Failed to change MBA BW state!")
623623

624624
log.info(f"RDT MBA BW {'en' if PQOS_API.is_mba_bw_enabled() else 'dis'}abled.")
625625
log.info(f"RDT L3 CDP {'en' if PQOS_API.is_l3_cdp_enabled() else 'dis'}abled.")

lib/python/.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ min-public-methods=1
207207
[EXCEPTIONS]
208208

209209
# Exceptions that will emit a warning when caught.
210-
overgeneral-exceptions=Exception
210+
overgeneral-exceptions=builtins.Exception
211211

212212

213213
[FORMAT]

lib/python/pqos/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def free_memory(ptr):
146146
libc_path = ctypes.util.find_library('c')
147147

148148
if not libc_path:
149-
raise Exception('Cannot find libc')
149+
raise OSError('Cannot find libc')
150150

151151
libc = ctypes.cdll.LoadLibrary(libc_path)
152152
libc.free(ptr)

tests/.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ min-public-methods=1
206206
[EXCEPTIONS]
207207

208208
# Exceptions that will emit a warning when caught.
209-
overgeneral-exceptions=Exception
209+
overgeneral-exceptions=builtins.Exception
210210

211211

212212
[FORMAT]

0 commit comments

Comments
 (0)