mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Use textwrap3 on Python 2
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user