From bf225856d3a0d77a7cad7f778490c014fa923da8 2017-05-25 18:19:15 From: Srinivas Reddy Thatiparthy Date: 2017-05-25 18:19:15 Subject: [PATCH] remove unused imports --- diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py index b612b8c..82e98e2 100644 --- a/IPython/sphinxext/ipython_directive.py +++ b/IPython/sphinxext/ipython_directive.py @@ -144,7 +144,6 @@ from sphinx.util.compat import Directive from traitlets.config import Config from IPython import InteractiveShell from IPython.core.profiledir import ProfileDir -from IPython.utils import io #----------------------------------------------------------------------------- # Globals diff --git a/IPython/terminal/pt_inputhooks/pyglet.py b/IPython/terminal/pt_inputhooks/pyglet.py index a063873..33635c4 100644 --- a/IPython/terminal/pt_inputhooks/pyglet.py +++ b/IPython/terminal/pt_inputhooks/pyglet.py @@ -1,7 +1,6 @@ """Enable pyglet to be used interacively with prompt_toolkit """ -import os import sys import time from timeit import default_timer as clock diff --git a/IPython/terminal/tests/test_help.py b/IPython/terminal/tests/test_help.py index 16a6f57..ec5bf6f 100644 --- a/IPython/terminal/tests/test_help.py +++ b/IPython/terminal/tests/test_help.py @@ -4,7 +4,6 @@ # Distributed under the terms of the Modified BSD License. import IPython.testing.tools as tt -from IPython.testing.decorators import skip_without def test_ipython_help(): diff --git a/IPython/utils/_process_cli.py b/IPython/utils/_process_cli.py index 6d96bd1..a7b7b90 100644 --- a/IPython/utils/_process_cli.py +++ b/IPython/utils/_process_cli.py @@ -11,11 +11,16 @@ interface for IronPython will probably require you to help fill in the details. """ - +# Import cli libraries: +import clr import System + +# Import Python libraries: import os -from IPython.utils import py3compat +# Import IPython libraries: +from IPython.utils import py3compat +from ._process_common import arg_split def _find_cmd(cmd): """Find the full path to a command using which.""" diff --git a/IPython/utils/openpy.py b/IPython/utils/openpy.py index 2680441..a45552b 100644 --- a/IPython/utils/openpy.py +++ b/IPython/utils/openpy.py @@ -7,7 +7,6 @@ Much of the code is taken from the tokenize module in Python 3.2. import io from io import TextIOWrapper, BytesIO -import os.path import re from tokenize import open, detect_encoding diff --git a/IPython/utils/tempdir.py b/IPython/utils/tempdir.py index 2e7ec51..98f6aeb 100644 --- a/IPython/utils/tempdir.py +++ b/IPython/utils/tempdir.py @@ -1,15 +1,13 @@ """ This module contains classes - NamedFileInTemporaryDirectory, TemporaryWorkingDirectory. -These classes add extra features such as creating a named file in temporary directory and +These classes add extra features such as creating a named file in temporary directory and creating a context manager for the working directory which is also temporary. """ import os as _os -import warnings as _warnings -import sys as _sys - from tempfile import TemporaryDirectory + class NamedFileInTemporaryDirectory(object): def __init__(self, filename, mode='w+b', bufsize=-1, **kwds): @@ -57,4 +55,3 @@ class TemporaryWorkingDirectory(TemporaryDirectory): def __exit__(self, exc, value, tb): _os.chdir(self.old_wd) return super(TemporaryWorkingDirectory, self).__exit__(exc, value, tb) - diff --git a/IPython/utils/terminal.py b/IPython/utils/terminal.py index b37a5d7..949275e 100644 --- a/IPython/utils/terminal.py +++ b/IPython/utils/terminal.py @@ -17,12 +17,6 @@ import sys import warnings from shutil import get_terminal_size as _get_terminal_size -from . import py3compat - -#----------------------------------------------------------------------------- -# Code -#----------------------------------------------------------------------------- - # This variable is part of the expected API of the module: ignore_termtitle = True diff --git a/IPython/utils/tests/test_shimmodule.py b/IPython/utils/tests/test_shimmodule.py index 64f111d..3a15617 100644 --- a/IPython/utils/tests/test_shimmodule.py +++ b/IPython/utils/tests/test_shimmodule.py @@ -1,11 +1,9 @@ import sys import warnings -import nose.tools as nt - -from IPython.utils.capture import capture_output from IPython.utils.shimmodule import ShimWarning + def test_shim_warning(): sys.modules.pop('IPython.config', None) with warnings.catch_warnings(record=True) as w: