From 26705ff219318333c43080b306c54ac80261c194 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 29 Mar 2026 08:51:47 +0300 Subject: [PATCH 1/3] fix: remove try-except with empty finally --- pyopencl/tools.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pyopencl/tools.py b/pyopencl/tools.py index efe931502..c843194bc 100644 --- a/pyopencl/tools.py +++ b/pyopencl/tools.py @@ -562,13 +562,9 @@ def first_arg_dependent_memoize_nested( frame = currentframe() cache_context = None if frame: - try: - caller_frame = frame.f_back - if caller_frame: - cache_context = caller_frame.f_globals[caller_frame.f_code.co_name] - finally: - # del caller_frame - pass + caller_frame = frame.f_back + if caller_frame: + cache_context = caller_frame.f_globals[caller_frame.f_code.co_name] cache_dict: dict[Hashable, dict[Hashable, RetT]] try: From 37eb5303a0ab74f78b07cc554471a172a65862ba Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 29 Mar 2026 08:52:01 +0300 Subject: [PATCH 2/3] fix: remove unused found flag --- pyopencl/cache.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyopencl/cache.py b/pyopencl/cache.py index f343347a1..4e45e75f9 100644 --- a/pyopencl/cache.py +++ b/pyopencl/cache.py @@ -204,7 +204,6 @@ def _inner(src: bytes): for match in C_INCLUDE_RE.finditer(src): included = match.group(1) - found = False for ipath in include_path: included_file_name = realpath(join(ipath, included.decode())) @@ -232,12 +231,8 @@ def _inner(src: bytes): checksum.hexdigest(), ) - found = True break # stop searching the include path - if not found: - pass - _inner(src) result_list = [ From df1e6ebccb60e2f84906ce225807832ef581c599 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 29 Mar 2026 08:52:11 +0300 Subject: [PATCH 3/3] fix: remove noqa for E501 --- pyopencl/array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyopencl/array.py b/pyopencl/array.py index 1c48ad276..67749da82 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -1935,7 +1935,7 @@ def reshape(self, *shape, **kwargs): # {{{ determine reshaped strides # copied and translated from - # https://github.com/numpy/numpy/blob/4083883228d61a3b571dec640185b5a5d983bf59/numpy/core/src/multiarray/shape.c # noqa: E501 + # https://github.com/numpy/numpy/blob/4083883228d61a3b571dec640185b5a5d983bf59/numpy/core/src/multiarray/shape.c newdims = shape newnd = len(newdims)