Unverified Commit 8842c5ff authored by Jelle Zijlstra's avatar Jelle Zijlstra Committed by GitHub
Browse files

in verbose mode, print stack trace (#1594)

Make Black failures easier to debug
parent 97c11f22
Loading
Loading
Loading
Loading
+3 −1
Changes for src/black/__init__.py: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -664,6 +664,8 @@ def reformat_one(
                write_cache(cache, [src], mode)
        report.done(src, changed)
    except Exception as exc:
        if report.verbose:
            traceback.print_exc()
        report.failed(src, str(exc))


@@ -3327,7 +3329,7 @@ def do_transform(self, line: Line, string_idx: int) -> Iterator[TResult[Line]]:
        new_line.append(string_leaf)

        append_leaves(
            new_line, line, LL[string_idx + 1 : rpar_idx] + LL[rpar_idx + 1 :],
            new_line, line, LL[string_idx + 1 : rpar_idx] + LL[rpar_idx + 1 :]
        )

        LL[rpar_idx].remove()