From 0d7694819b764662dc497eaa5f84a93d72a4e8e2 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Thu, 25 May 2017 20:22:00 +0100 Subject: [PATCH] Remove unused variables and imports pipenv/cli.py:24:1: F401 '.utils.recase_file' imported but unused pipenv/cli.py:466:5: F841 local variable 'p' is assigned to but never used pipenv/utils.py:13:5: F401 'html.parser.HTMLParser' imported but unused pipenv/utils.py:246:25: F841 local variable 'e' is assigned to but never used tests/test_pipenv.py:9:1: F401 'pipenv.cli.which_pip' imported but unused --- pipenv/cli.py | 4 ++-- pipenv/utils.py | 7 +------ tests/test_pipenv.py | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 184b3f98..2896be33 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -22,7 +22,7 @@ from requests.packages.urllib3.exceptions import InsecureRequestWarning from .project import Project from .utils import (convert_deps_from_pip, convert_deps_to_pip, is_required_version, - proper_case, pep423_name, split_vcs, recase_file) + proper_case, pep423_name, split_vcs) from .__version__ import __version__ from . import pep508checker, progress from .environments import PIPENV_COLORBLIND, PIPENV_NOSPIN, PIPENV_SHELL_COMPAT, PIPENV_VENV_IN_PROJECT @@ -463,7 +463,7 @@ def do_lock(no_hashes=True): names_map = do_download_dependencies(dev=True, only=True, bare=True) # Load the Pipfile and generate a lockfile. - p = project._pipfile + project._pipfile lockfile = project._lockfile # Pip freeze development dependencies. diff --git a/pipenv/utils.py b/pipenv/utils.py index 995c5217..ced5030d 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -7,11 +7,6 @@ import requests import requirements import six -try: - from HTMLParser import HTMLParser -except ImportError: - from html.parser import HTMLParser - # List of version control systems we support. VCS_LIST = ('git', 'svn', 'hg', 'bzr') @@ -243,7 +238,7 @@ def walk_up(bottom): # get files in current dir try: names = os.listdir(bottom) - except Exception as e: + except Exception: return dirs, nondirs = [], [] diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 82f98ecd..237b3e29 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -7,7 +7,7 @@ import delegator import toml from pipenv.cli import (activate_virtualenv, ensure_proper_casing, - parse_download_fname, parse_install_output, pip_install, pip_download, which_pip) + parse_download_fname, parse_install_output, pip_install, pip_download) from pipenv.project import Project