-
Notifications
You must be signed in to change notification settings - Fork 0
/
blacken-docs.patch
23 lines (22 loc) · 1.03 KB
/
blacken-docs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- blacken_docs.py 2021-06-05 04:05:58.712881504 +0300
+++ blacken_docs_new.py 2021-06-05 04:04:19.199302295 +0300
@@ -121,18 +121,10 @@
fragment_lines = fragment.splitlines()
code += f'{PYCON_PREFIX}{fragment_lines[0]}\n'
for line in fragment_lines[1:]:
- # Skip blank lines to handle Black adding a blank above
- # functions within blocks. A blank line would end the REPL
- # continuation prompt.
- #
- # >>> if True:
- # ... def f():
- # ... pass
- # ...
if line:
code += f'{PYCON_CONTINUATION_PREFIX} {line}\n'
- if fragment_lines[-1].startswith(' '):
- code += f'{PYCON_CONTINUATION_PREFIX}\n'
+ else:
+ code += f'{PYCON_CONTINUATION_PREFIX}\n'
fragment = None
indentation = None