Show More
@@ -1,13 +1,11 b'' | |||
|
1 | 1 | try: |
|
2 | 2 | import argparse |
|
3 | # Workaround an argparse bug, FIXED in argparse 1.1.0 | |
|
4 | if 'RawTextHelpFormatterArgumentDefaultsHelpFormatter' in argparse.__all__: | |
|
5 |
|
|
|
6 | argparse.__all__ = list(itertools.chain( [i for i in argparse.__all__ | |
|
7 | if i != 'RawTextHelpFormatterArgumentDefaultsHelpFormatter'], | |
|
8 | ['RawTextHelpFormatter', 'ArgumentDefaultsHelpFormatter'])) | |
|
9 | argparse.__all__.append('SUPPRESS') | |
|
10 | from argparse import * | |
|
11 | except ImportError: | |
|
3 | # don't use system argparse if older than 1.1: | |
|
4 | if argparse.__version__ < '1.1': | |
|
5 | raise ImportError | |
|
6 | else: | |
|
7 | from argparse import * | |
|
8 | from argparse import SUPPRESS | |
|
9 | except (ImportError, AttributeError): | |
|
12 | 10 | from _argparse import * |
|
13 | 11 | from _argparse import SUPPRESS |
General Comments 0
You need to be logged in to leave comments.
Login now