mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
fix reference losing for _pipfile
This commit is contained in:
@@ -271,6 +271,18 @@ class TOMLFile:
|
||||
def elements(self):
|
||||
return self._elements
|
||||
|
||||
_marker = object()
|
||||
|
||||
def pop(self, item, default=_marker):
|
||||
"""Pops an item and return the value"""
|
||||
if item in self:
|
||||
rv = self[item]
|
||||
del self[item]
|
||||
return rv
|
||||
if default is self._marker:
|
||||
raise KeyError(item)
|
||||
return default
|
||||
|
||||
def __str__(self):
|
||||
|
||||
is_empty = (not self['']) and (not tuple(k for k in self.keys() if k))
|
||||
|
||||
+1
-1
@@ -377,7 +377,7 @@ class Project(object):
|
||||
# mutation time!
|
||||
self.clear_pipfile_cache()
|
||||
for section in ('packages', 'dev-packages'):
|
||||
p_section = dict(pfile.get(section, {}))
|
||||
p_section = pfile.get(section, {})
|
||||
for key in list(p_section.keys()):
|
||||
# Normalize key name to PEP 423.
|
||||
norm_key = pep423_name(key)
|
||||
|
||||
Reference in New Issue
Block a user