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