| 2836 | self._print_message(usage_text, file) |
| 2837 | |
| 2838 | def print_help(self, file=None): |
| 2839 | if file is None: |
| 2840 | file = _sys.stdout |
| 2841 | formatter = self._get_formatter(file=file) |
| 2842 | try: |
| 2843 | help_text = self.format_help(formatter=formatter) |
| 2844 | except TypeError: |
| 2845 | # Backward compatibility for formatter classes that |
| 2846 | # do not accept the 'formatter' keyword argument. |
| 2847 | help_text = self.format_help() |
| 2848 | self._print_message(help_text, file) |
| 2849 | |
| 2850 | def _print_message(self, message, file=None): |
| 2851 | if message: |