Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use bundled argparse if system argparse is < 1.1 #726

Merged
merged 1 commit into from Aug 23, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 7 additions & 9 deletions IPython/external/argparse/__init__.py
@@ -1,13 +1,11 @@
try: try:
import argparse import argparse
# Workaround an argparse bug, FIXED in argparse 1.1.0 # don't use system argparse if older than 1.1:
if 'RawTextHelpFormatterArgumentDefaultsHelpFormatter' in argparse.__all__: if argparse.__version__ < '1.1':
import itertools raise ImportError
argparse.__all__ = list(itertools.chain( [i for i in argparse.__all__ else:
if i != 'RawTextHelpFormatterArgumentDefaultsHelpFormatter'], from argparse import *
['RawTextHelpFormatter', 'ArgumentDefaultsHelpFormatter'])) from argparse import SUPPRESS
argparse.__all__.append('SUPPRESS') except (ImportError, AttributeError):
from argparse import *
except ImportError:
from _argparse import * from _argparse import *
from _argparse import SUPPRESS from _argparse import SUPPRESS