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) 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 = [ 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: