Skip to content

Commit

Permalink
Code update
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 701994077
  • Loading branch information
oprypin authored and The etils Authors committed Dec 2, 2024
1 parent 4770c38 commit 5a1cfa3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions etils/ecolab/auto_display_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5a1cfa3

Please sign in to comment.