Skip to content

Commit

Permalink
building: Refactor the SmartFormatter used for argparse.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjones1 committed Jun 22, 2018
1 parent 3aaae15 commit 9dd8300
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions PyInstaller/__main__.py
Expand Up @@ -36,10 +36,12 @@ class _SmartFormatter(argparse.HelpFormatter):

def _split_lines(self, text, width):
if text.startswith('R|'):
return argparse.RawTextHelpFormatter._split_lines(self, text[2:],
width)
# The underlying implementation of ``RawTextHelpFormatter._split_lines``
# invokes this; mimic it.
return text[2:].splitlines()
else:
return argparse.HelpFormatter._split_lines(self, text, width)
# Invoke the usual formatter.
return super(_SmartFormatter, self)._split_lines(text, width)


def run_makespec(filenames, **opts):
Expand Down

0 comments on commit 9dd8300

Please sign in to comment.