remove redundant lines

This commit is contained in:
Frost Ming
2018-03-29 20:29:34 +08:00
parent aff9078985
commit 786929b0bf
2 changed files with 4 additions and 13 deletions
-6
View File
@@ -503,9 +503,6 @@ def lock(
# Ensure that virtualenv is available.
core.ensure_project(three=three, python=python)
# Load the --pre settings from the Pipfile.
if not pre:
pre = core.project.settings.get('pre')
if requirements:
core.do_init(dev=dev, requirements=requirements)
core.do_lock(
@@ -739,9 +736,6 @@ def update(
crayons.white('.', bold=True),
)
)
# Load the --pre settings from the Pipfile.
if not pre:
pre = core.project.settings.get('pre')
core.do_lock(
verbose=verbose, clear=clear, pre=pre, keep_outdated=keep_outdated
)
+4 -7
View File
@@ -1645,7 +1645,6 @@ def warn_in_virtualenv():
def ensure_lockfile(keep_outdated=False):
"""Ensures that the lockfile is uptodate."""
pre = project.settings.get('allow_prereleases')
if not keep_outdated:
keep_outdated = project.settings.get('keep_outdated')
# Write out the lockfile if it doesn't exist, but not if the Pipfile is being ignored
@@ -1662,9 +1661,9 @@ def ensure_lockfile(keep_outdated=False):
),
err=True,
)
do_lock(pre=pre, keep_outdated=keep_outdated)
do_lock(keep_outdated=keep_outdated)
else:
do_lock(pre=pre, keep_outdated=keep_outdated)
do_lock(keep_outdated=keep_outdated)
def do_py(system=False):
@@ -2019,8 +2018,6 @@ def do_uninstall(
system = True
# Ensure that virtualenv is available.
ensure_project(three=three, python=python)
# Load the --pre settings from the Pipfile.
pre = project.settings.get('allow_prereleases')
package_names = (package_name,) + more_packages
pipfile_remove = True
# Un-install all dependencies, if --all was provided.
@@ -2087,7 +2084,7 @@ def do_uninstall(
project.remove_package_from_pipfile(package_name, dev=True)
project.remove_package_from_pipfile(package_name, dev=False)
if lock:
do_lock(system=system, pre=pre, keep_outdated=keep_outdated)
do_lock(system=system, keep_outdated=keep_outdated)
def do_shell(three=None, python=False, fancy=False, shell_args=None):
@@ -2185,7 +2182,7 @@ def inline_activate_virtualenv():
activate_this = which('activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec (code, dict(__file__=activate_this))
exec(code, dict(__file__=activate_this))
# Catch all errors, just in case.
except Exception:
click.echo(