Use textwrap3 on Python 2

This commit is contained in:
Robin Dunn
2019-05-31 08:57:15 -07:00
parent d29f17353e
commit e234a65cd7
3 changed files with 7 additions and 12 deletions

View File

@@ -969,14 +969,3 @@ def updateLicenseFiles(cfg):
with open('LICENSE.txt', 'w') as f:
f.write(text)
try:
from textwrap import indent
except ImportError:
def indent(text, prefix, predicate=None):
if predicate is None:
def predicate(line):
return line.strip()
def prefixed_lines():
for line in text.splitlines(True):
yield (prefix + line if predicate(line) else line)
return ''.join(prefixed_lines())