Skip to content

Commit bb387b8

Browse files
committed
CLN: fixed a few code style issues reported by PyCharm inspections
1 parent 4297aec commit bb387b8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

larray_editor/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ def get_name(i, obj, depth=0):
222222
_orig_except_hook = sys.excepthook
223223

224224

225-
def _qt_except_hook(type, value, tback):
225+
def _qt_except_hook(type_, value, tback):
226226
# only print the exception and do *not* exit the program
227-
traceback.print_exception(type, value, tback)
227+
traceback.print_exception(type_, value, tback)
228228
# only catch simple Exception (avoid catching KeyboardInterrupt, ...)
229229
if not isinstance(value, Exception):
230230
# in a Qt app, the except hook is only called when the window gets the focus again,
@@ -272,7 +272,7 @@ def _get_debug_except_hook(root_path=None, usercode_traceback=True, usercode_fra
272272
if root_path is None:
273273
root_path = os.path.dirname(main_file)
274274

275-
def excepthook(type, value, tback):
275+
def excepthook(type_, value, tback):
276276
# first try to go as far as the main module because in some cases (e.g. when we run the file via a debugger),
277277
# the top of the traceback is not always the main module
278278
current_tb = tback
@@ -295,7 +295,7 @@ def excepthook(type, value, tback):
295295
user_tb_length += 1
296296

297297
tb_limit = user_tb_length if usercode_traceback else None
298-
traceback.print_exception(type, value, main_tb, limit=tb_limit)
298+
traceback.print_exception(type_, value, main_tb, limit=tb_limit)
299299

300300
# open the editor if this is a simple Exception (i.e. not KeyboardInterrupt, ...)
301301
if isinstance(value, Exception):

larray_editor/arrayadapter.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
REGISTERED_ADAPTERS = {}
99

1010

11-
def register_adapter(type):
11+
def register_adapter(target_type):
1212
"""Class decorator to register new adapter
1313
1414
Parameters
1515
----------
16-
type : type
17-
Type associated with adapter class.
16+
target_type : type
17+
Type handled by adapter class.
1818
"""
19-
def decorate_class(cls):
20-
if type not in REGISTERED_ADAPTERS:
21-
REGISTERED_ADAPTERS[type] = cls
22-
return cls
19+
def decorate_class(adapter_cls):
20+
if target_type not in REGISTERED_ADAPTERS:
21+
REGISTERED_ADAPTERS[target_type] = adapter_cls
22+
return adapter_cls
2323
return decorate_class
2424

2525

0 commit comments

Comments
 (0)