From 8fdca78371e75a92515050738ce05ba55846e576 Mon Sep 17 00:00:00 2001 From: Guilherme Leobas Date: Tue, 1 Aug 2023 18:55:32 -0300 Subject: [PATCH] Fix for Python 3.7 (#577) * Fix for Python 3.7 * flake8 * flake8 --- rbc/external.py | 7 ++++--- rbc/targetinfo.py | 2 +- rbc/tests/heavydb/test_array.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/rbc/external.py b/rbc/external.py index 31bac5aec..853c7c434 100644 --- a/rbc/external.py +++ b/rbc/external.py @@ -111,9 +111,10 @@ def match_signature(self, atypes): satypes = ", ".join(map(str, atypes)) raise TypeError( - f"{compile_target=}: found no matching function type to the given argument types" - f" `{satypes}` and device `{device}` while processing `{self.name}`." - f" Available function type is `{this_type}`." + f"compile_target={compile_target}: found no matching function type " + f"to the given argument types `{satypes}` and device `{device}` " + f"while processing `{self.name}`. Available function type is " + f"`{this_type}`." ) def get_codegen(self): diff --git a/rbc/targetinfo.py b/rbc/targetinfo.py index d7c326cbc..eb595f43e 100644 --- a/rbc/targetinfo.py +++ b/rbc/targetinfo.py @@ -119,7 +119,7 @@ def add_library(self, lib): def set_compile_target(self, target_name): """Set target function name being compiled. """ - assert target_name is None or self._compile_target is None,\ + assert target_name is None or self._compile_target is None, \ (target_name, self._compile_target) self._compile_target = target_name diff --git a/rbc/tests/heavydb/test_array.py b/rbc/tests/heavydb/test_array.py index 19f6ab19c..7bf48825b 100644 --- a/rbc/tests/heavydb/test_array.py +++ b/rbc/tests/heavydb/test_array.py @@ -207,7 +207,7 @@ def array_getitem_double(x, i): desrc, result = heavydb.sql_execute(query) for a, item in result: assert a[2] == item - assert type(a[2]) == type(item) + assert type(a[2]) is type(item) @heavydb('float(float[], int64)') def array_getitem_float(x, i): @@ -217,7 +217,7 @@ def array_getitem_float(x, i): desrc, result = heavydb.sql_execute(query) for a, item in result: assert a[2] == item - assert type(a[2]) == type(item) + assert type(a[2]) is type(item) def test_sum(heavydb):