From 45e2dad19b6b2663dc663ee8c605040809cf3854 2013-09-16 21:17:45 From: Thomas Kluyver Date: 2013-09-16 21:17:45 Subject: [PATCH] Import argparse directly from stdlib --- diff --git a/IPython/config/loader.py b/IPython/config/loader.py index 9e2e725..919531a 100644 --- a/IPython/config/loader.py +++ b/IPython/config/loader.py @@ -24,11 +24,11 @@ Authors #----------------------------------------------------------------------------- import __builtin__ as builtin_mod +import argparse import os import re import sys -from IPython.external import argparse from IPython.utils.path import filefind, get_ipython_dir from IPython.utils import py3compat, warn from IPython.utils.encoding import DEFAULT_ENCODING diff --git a/IPython/core/magic_arguments.py b/IPython/core/magic_arguments.py index 88afb78..e83b521 100644 --- a/IPython/core/magic_arguments.py +++ b/IPython/core/magic_arguments.py @@ -50,9 +50,9 @@ Inheritance diagram: # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import argparse # Our own imports -from IPython.external import argparse from IPython.core.error import UsageError from IPython.utils.process import arg_split from IPython.utils.text import dedent diff --git a/IPython/core/tests/test_magic_arguments.py b/IPython/core/tests/test_magic_arguments.py index dc970ae..92ae04a 100644 --- a/IPython/core/tests/test_magic_arguments.py +++ b/IPython/core/tests/test_magic_arguments.py @@ -6,9 +6,9 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- +import argparse from nose.tools import assert_equal -from IPython.external import argparse from IPython.core.magic_arguments import (argument, argument_group, kwds, magic_arguments, parse_argstring, real_name) diff --git a/IPython/external/mathjax.py b/IPython/external/mathjax.py index f98411e..d0d2ebc 100644 --- a/IPython/external/mathjax.py +++ b/IPython/external/mathjax.py @@ -50,6 +50,7 @@ To find the directory where IPython would like MathJax installed: # Imports #----------------------------------------------------------------------------- +import argparse import os import shutil import sys @@ -59,7 +60,6 @@ import zipfile from IPython.utils.path import locate_profile -from IPython.external import argparse #----------------------------------------------------------------------------- # #----------------------------------------------------------------------------- diff --git a/IPython/nbformat/v3/validator.py b/IPython/nbformat/v3/validator.py index b9b1244..3bbca3b 100755 --- a/IPython/nbformat/v3/validator.py +++ b/IPython/nbformat/v3/validator.py @@ -1,11 +1,11 @@ #!/usr/bin/env python # -*- coding: utf8 -*- +import argparse +import traceback +import json from IPython.external.jsonschema import Draft3Validator, validate, ValidationError import IPython.external.jsonpointer as jsonpointer -from IPython.external import argparse -import traceback -import json def nbvalidate(nbjson, schema='v3.withref.json', key=None,verbose=True): v3schema = resolve_ref(json.load(open(schema,'r')))