From 5a1cfa3a0d42fe203491776a9724ea346887fc54 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Mon, 2 Dec 2024 09:30:08 -0800 Subject: [PATCH] Code update PiperOrigin-RevId: 701994077 --- etils/ecolab/auto_display_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etils/ecolab/auto_display_utils.py b/etils/ecolab/auto_display_utils.py index da8bed2..315e50b 100644 --- a/etils/ecolab/auto_display_utils.py +++ b/etils/ecolab/auto_display_utils.py @@ -259,7 +259,7 @@ def _maybe_display( if line_info.print_line: fn_kwargs.append(ast.keyword('line_code', _unparse_line(node))) - node.value = ast.Call( + node.value = ast.Call( # pytype: disable=wrong-arg-types func=_parse_expr('ecolab.auto_display_utils._display_and_return'), args=[node.value], keywords=fn_kwargs, @@ -350,12 +350,12 @@ def _has_trailing_semicolon( ) # Extract the lines of the statement - line_num = node.end_lineno - 1 + line_num = node.end_lineno - 1 # pytype: disable=attribute-error last_line = code_lines[line_num] # lineno starts at `1` # `node.end_col_offset` is in bytes, so UTF-8 characters count 3. last_part_of_line = last_line.encode('utf-8') - last_part_of_line = last_part_of_line[node.end_col_offset :] + last_part_of_line = last_part_of_line[node.end_col_offset :] # pytype: disable=attribute-error last_part_of_line = last_part_of_line.decode('utf-8') # Check if the last character is a `;` token