mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +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:
|
with open('LICENSE.txt', 'w') as f:
|
||||||
f.write(text)
|
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())
|
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ pytest
|
|||||||
pytest-xdist
|
pytest-xdist
|
||||||
pytest-timeout
|
pytest-timeout
|
||||||
pathlib2 ; python_version < "3"
|
pathlib2 ; python_version < "3"
|
||||||
|
textwrap3 ; python_version < "3"
|
||||||
|
|||||||
7
wscript
7
wscript
@@ -10,7 +10,12 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from buildtools.config import Config, runcmd, msg, indent
|
try:
|
||||||
|
from textwrap import indent
|
||||||
|
except ImportError:
|
||||||
|
from textwrap3 import indent
|
||||||
|
|
||||||
|
from buildtools.config import Config, runcmd, msg
|
||||||
cfg = Config(True)
|
cfg = Config(True)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user