mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Use context manager when opening Pipfile
This commit is contained in:
@@ -1028,7 +1028,6 @@ def do_lock(
|
||||
pypi_mirror=None,
|
||||
):
|
||||
"""Executes the freeze functionality."""
|
||||
|
||||
cached_lockfile = {}
|
||||
if not pre:
|
||||
pre = project.settings.get("allow_prereleases")
|
||||
|
||||
+2
-3
@@ -556,9 +556,8 @@ class Project:
|
||||
@property
|
||||
def _lockfile(self):
|
||||
"""Pipfile.lock divided by PyPI and external dependencies."""
|
||||
lockfile = plette.Lockfile.with_meta_from(
|
||||
plette.Pipfile.load(open(self.pipfile_location))
|
||||
)
|
||||
with open(self.pipfile_location) as pf:
|
||||
lockfile = plette.Lockfile.with_meta_from(plette.Pipfile.load(pf))
|
||||
for section in ("default", "develop"):
|
||||
lock_section = lockfile.get(section, {})
|
||||
for key in list(lock_section.keys()):
|
||||
|
||||
Reference in New Issue
Block a user