mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #1536 from uranusjr/fix-prettytoml-del
Fix __delitem__ in prettytoml’s table element
This commit is contained in:
@@ -105,7 +105,7 @@ class TableElement(abstracttable.AbstractTable):
|
||||
preceding_newline = self._find_preceding_newline(begin)
|
||||
if preceding_newline >= 0:
|
||||
begin = preceding_newline
|
||||
end = self._find_following_newline(begin)
|
||||
end = self._find_following_line_terminator(begin)
|
||||
if end < 0:
|
||||
end = len(tuple(self._sub_elements))
|
||||
self._sub_elements = self.sub_elements[:begin] + self.sub_elements[end:]
|
||||
|
||||
@@ -76,9 +76,9 @@ class TraversalMixin:
|
||||
following_comment = self._find_following_comment(index)
|
||||
following_newline = self._find_following_newline(index)
|
||||
|
||||
if following_comment == float('-inf'):
|
||||
if following_comment == float('inf'):
|
||||
return following_newline
|
||||
if following_newline == float('inf'):
|
||||
if following_newline == float('-inf'):
|
||||
return following_comment
|
||||
|
||||
if following_newline < following_comment:
|
||||
|
||||
Reference in New Issue
Block a user