From 4131f7286ca9dd7a0708f20293187eab104c9b9e Mon Sep 17 00:00:00 2001 From: Bartlomiej Hirsz Date: Mon, 6 May 2024 12:49:26 +0200 Subject: [PATCH] Fix auto conversion for NormalizeNewLines --- robotidy/transformers/NormalizeNewLines.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/robotidy/transformers/NormalizeNewLines.py b/robotidy/transformers/NormalizeNewLines.py index 76208319..0a827b1b 100644 --- a/robotidy/transformers/NormalizeNewLines.py +++ b/robotidy/transformers/NormalizeNewLines.py @@ -1,4 +1,4 @@ -from __future__ import annotations +from typing import Optional from robot.api.parsing import CommentSection, EmptyLine, Token @@ -37,7 +37,9 @@ class NormalizeNewLines(Transformer): def __init__( self, test_case_lines: int = 1, - keyword_lines: int | None = None, + # | was added in Python 3.10. We can't use it with from __future__ import annotations because of RF + # auto conversion - future annotations replaces everything to string + keyword_lines: Optional[int] = None, section_lines: int = 2, separate_templated_tests: bool = False, consecutive_lines: int = 1,