From a8f31324dbe2808ad0c335f657f2e8031a576722 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 16 Aug 2023 07:37:36 +0100 Subject: [PATCH] Replace NamedTuple with plain class --- src/blacken_docs/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blacken_docs/__init__.py b/src/blacken_docs/__init__.py index 6d4a216..7775f43 100644 --- a/src/blacken_docs/__init__.py +++ b/src/blacken_docs/__init__.py @@ -6,7 +6,6 @@ import textwrap from typing import Generator from typing import Match -from typing import NamedTuple from typing import Sequence import black @@ -88,9 +87,10 @@ TRAILING_NL_RE = re.compile(r"\n+\Z", re.MULTILINE) -class CodeBlockError(NamedTuple): - offset: int - exc: Exception +class CodeBlockError: + def __init__(self, offset: int, exc: Exception) -> None: + self.offset = offset + self.exc = exc def format_str(