From adf10a5ad2206ae7703913396b39bbeb4137ab23 2017-05-25 17:07:49 From: Srinivas Reddy Thatiparthy Date: 2017-05-25 17:07:49 Subject: [PATCH] remove unused imports --- diff --git a/IPython/core/application.py b/IPython/core/application.py index b8f0472..8e14b72 100644 --- a/IPython/core/application.py +++ b/IPython/core/application.py @@ -26,7 +26,6 @@ from IPython.core import release, crashhandler from IPython.core.profiledir import ProfileDir, ProfileDirError from IPython.paths import get_ipython_dir, get_ipython_package_dir from IPython.utils.path import ensure_dir_exists -from IPython.utils import py3compat from traitlets import ( List, Unicode, Type, Bool, Dict, Set, Instance, Undefined, default, observe, diff --git a/IPython/core/extensions.py b/IPython/core/extensions.py index cb44fea..8028b99 100644 --- a/IPython/core/extensions.py +++ b/IPython/core/extensions.py @@ -6,8 +6,6 @@ import os import os.path -import warnings -from shutil import copyfile import sys from importlib import import_module diff --git a/IPython/core/history.py b/IPython/core/history.py index 9d229a9..4d3719e 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -21,7 +21,6 @@ from traitlets.config.configurable import LoggingConfigurable from decorator import decorator from IPython.utils.decorators import undoc from IPython.utils.path import locate_profile -from IPython.utils import py3compat from traitlets import ( Any, Bool, Dict, Instance, Integer, List, Unicode, TraitError, default, observe, diff --git a/IPython/core/macro.py b/IPython/core/macro.py index 0b81f89..ce86898 100644 --- a/IPython/core/macro.py +++ b/IPython/core/macro.py @@ -9,7 +9,6 @@ import re -from IPython.utils import py3compat from IPython.utils.encoding import DEFAULT_ENCODING coding_declaration = re.compile(r"#\s*coding[:=]\s*([-\w.]+)") diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 592d6a3..782063a 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -14,7 +14,6 @@ import os import re import sys -import types from getopt import getopt, GetoptError from traitlets.config.configurable import Configurable diff --git a/IPython/core/magics/extension.py b/IPython/core/magics/extension.py index 7c751fa..ba93b3b 100644 --- a/IPython/core/magics/extension.py +++ b/IPython/core/magics/extension.py @@ -12,13 +12,10 @@ # Imports #----------------------------------------------------------------------------- -# Stdlib -import os # Our own packages from IPython.core.error import UsageError from IPython.core.magic import Magics, magics_class, line_magic -from warnings import warn #----------------------------------------------------------------------------- # Magic implementation classes diff --git a/IPython/core/magics/osm.py b/IPython/core/magics/osm.py index 9436ee4..7e87b97 100644 --- a/IPython/core/magics/osm.py +++ b/IPython/core/magics/osm.py @@ -23,7 +23,6 @@ from IPython.core.magic import ( from IPython.testing.skipdoctest import skip_doctest from IPython.utils.openpy import source_to_unicode from IPython.utils.process import abbrev_cwd -from IPython.utils import py3compat from IPython.utils.terminal import set_term_title diff --git a/IPython/core/profileapp.py b/IPython/core/profileapp.py index f43962f..59282a2 100644 --- a/IPython/core/profileapp.py +++ b/IPython/core/profileapp.py @@ -30,7 +30,6 @@ from IPython.core.application import ( from IPython.core.profiledir import ProfileDir from IPython.utils.importstring import import_item from IPython.paths import get_ipython_dir, get_ipython_package_dir -from IPython.utils import py3compat from traitlets import Unicode, Bool, Dict, observe #----------------------------------------------------------------------------- diff --git a/IPython/core/profiledir.py b/IPython/core/profiledir.py index 6c0dc7b..6ab600f 100644 --- a/IPython/core/profiledir.py +++ b/IPython/core/profiledir.py @@ -11,7 +11,6 @@ import errno from traitlets.config.configurable import LoggingConfigurable from IPython.paths import get_ipython_package_dir from IPython.utils.path import expand_path, ensure_dir_exists -from IPython.utils import py3compat from traitlets import Unicode, Bool, observe #----------------------------------------------------------------------------- diff --git a/IPython/core/prompts.py b/IPython/core/prompts.py index ec7f911..7fd218d 100644 --- a/IPython/core/prompts.py +++ b/IPython/core/prompts.py @@ -2,8 +2,6 @@ """Being removed """ -from IPython.utils import py3compat - class LazyEvaluate(object): """This is used for formatting strings with values that need to be updated at that time, such as the current time or working directory.""" diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 11807ea..78158a2 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -8,7 +8,6 @@ from io import BytesIO from IPython.core.display import _pngxy from IPython.utils.decorators import flag_calls -from IPython.utils import py3compat # If user specifies a GUI, that dictates the backend, otherwise we read the # user's mpl default from the mpl rc structure @@ -97,7 +96,6 @@ def print_figure(fig, fmt='png', bbox_inches='tight', **kwargs): Any keyword args are passed to fig.canvas.print_figure, such as ``quality`` or ``bbox_inches``. """ - from matplotlib import rcParams # When there's an empty figure, we shouldn't return anything, otherwise we # get big blank areas in the qt console. if not fig.axes and not fig.lines: diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index a4358dd..e159fc4 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -15,7 +15,6 @@ from traitlets.config.application import boolean_flag from traitlets.config.configurable import Configurable from traitlets.config.loader import Config from IPython.core import pylabtools -from IPython.utils import py3compat from IPython.utils.contexts import preserve_keys from IPython.utils.path import filefind from traitlets import ( diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index cabb11c..f791e2b 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -100,7 +100,6 @@ import sys import time import tokenize import traceback -import types try: # Python 2 generate_tokens = tokenize.generate_tokens diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py index 4a153bd..9fe465d 100644 --- a/IPython/lib/pretty.py +++ b/IPython/lib/pretty.py @@ -87,8 +87,7 @@ from io import StringIO from warnings import warn from IPython.utils.decorators import undoc -from IPython.utils.py3compat import PYPY, cast_unicode -from IPython.utils.encoding import get_stream_enc +from IPython.utils.py3compat import PYPY __all__ = ['pretty', 'pprint', 'PrettyPrinter', 'RepresentationPrinter',