From 959f26b4cf76a70c3457506e2a6198346090198e Mon Sep 17 00:00:00 2001 From: XD-DENG Date: Wed, 18 Dec 2019 22:22:03 +0800 Subject: [PATCH] Fix Type Error Log The 2nd argument should be a list, otherwise we see log like below ``` TypeError: 'total_rows' must be of type 'i', 'n', 't', received '' ``` --- optimus/helpers/raiseit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/optimus/helpers/raiseit.py b/optimus/helpers/raiseit.py index f3282bd5..1cda7515 100644 --- a/optimus/helpers/raiseit.py +++ b/optimus/helpers/raiseit.py @@ -1,4 +1,4 @@ -from optimus.helpers.converter import one_list_to_val +from optimus.helpers.converter import one_list_to_val, val_to_list class RaiseIt: @@ -8,9 +8,10 @@ def type_error(var, data_types): """ Raise a TypeError exception :param var: - :param data_types: data types expected as strings + :param data_types: data types expected as string or list of strings :return: """ + data_types = val_to_list(data_types) from optimus.helpers.debug import get_var_name if len(data_types) == 1: