From: Jelle Zijlstra Date: Thu, 13 Aug 2020 18:14:34 +0000 (-0700) Subject: in verbose mode, print stack trace (#1594) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/8842c5ffa888aab2e4961fc54db45e7f3ca32ad9?ds=inline in verbose mode, print stack trace (#1594) Make Black failures easier to debug --- diff --git a/src/black/__init__.py b/src/black/__init__.py index 803c7a1..349da1e 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -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 @@ class StringParenStripper(StringTransformer): 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()