Skip to content

Commit c36e30b

Browse files
iabdalkaderpfalcon
authored andcommitted
tools/gen-cpydiff.py: Fix formatting of doc strings for new Black.
Since version 21.4b0, Black now processes one-line docstrings by stripping leading and trailing spaces, and adding a padding space when needed to break up """"; see psf/black#1740 This commit makes the Python code in this repository conform to this rule.
1 parent 532b90c commit c36e30b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/gen-cpydiff.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575

7676
def readfiles():
77-
""" Reads test files """
77+
"""Reads test files"""
7878
tests = list(filter(lambda x: x.endswith(".py"), os.listdir(TESTPATH)))
7979
tests.sort()
8080
files = []
@@ -95,7 +95,7 @@ def readfiles():
9595

9696

9797
def uimports(code):
98-
""" converts CPython module names into MicroPython equivalents """
98+
"""converts CPython module names into MicroPython equivalents"""
9999
for uimport in UIMPORTLIST:
100100
uimport = bytes(uimport, "utf8")
101101
code = code.replace(b"import " + uimport, b"import u" + uimport + b" as " + uimport)
@@ -108,7 +108,7 @@ def clean_output(output):
108108

109109

110110
def run_tests(tests):
111-
""" executes all tests """
111+
"""executes all tests"""
112112
results = []
113113
for test in tests:
114114
with open(TESTPATH + test.name, "rb") as f:
@@ -157,15 +157,15 @@ def run_tests(tests):
157157

158158

159159
def indent(block, spaces):
160-
""" indents paragraphs of text for rst formatting """
160+
"""indents paragraphs of text for rst formatting"""
161161
new_block = ""
162162
for line in block.split("\n"):
163163
new_block += spaces + line + "\n"
164164
return new_block
165165

166166

167167
def gen_table(contents):
168-
""" creates a table given any set of columns """
168+
"""creates a table given any set of columns"""
169169
xlengths = []
170170
ylengths = []
171171
for column in contents:
@@ -199,7 +199,7 @@ def gen_table(contents):
199199

200200

201201
def gen_rst(results):
202-
""" creates restructured text documents to display tests """
202+
"""creates restructured text documents to display tests"""
203203

204204
# make sure the destination directory exists
205205
try:
@@ -258,7 +258,7 @@ def gen_rst(results):
258258

259259

260260
def main():
261-
""" Main function """
261+
"""Main function"""
262262

263263
# set search path so that test scripts find the test modules (and no other ones)
264264
os.environ["PYTHONPATH"] = TESTPATH

0 commit comments

Comments
 (0)