Skip to content
Snippets Groups Projects
Commit e422c99c authored by Pierre Penninckx's avatar Pierre Penninckx Committed by GitHub
Browse files

Merge pull request #122 from rojaster/repr_recursion_fix

Unsynchronized tree: __repr__ recursion fix for #119, #121
parents 782ada18 990eebd2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -88,4 +88,5 @@ tramp
/auto/
 
# PyCharm files
.idea/*.*
\ No newline at end of file
.idea/*.*
.idea/
\ No newline at end of file
Loading
Loading
@@ -5,6 +5,7 @@ Changelog
-----------------
 
- fix help() after append
- fix _synchronise() for base_nodes to avoid recursion in __repr__ function if code run not in the shell
 
0.6.2 (2016-10-03)
----------------
Loading
Loading
Loading
Loading
@@ -118,7 +118,11 @@ class Path(object):
parent = parent.node_list
 
if isinstance(parent, NodeList):
pos = parent.index(node.node_list if isinstance(node, ProxyList) else node)
if isinstance(node, ProxyList):
item = node.node_list
else:
item = node
pos = parent.index(item)
return pos
 
if isinstance(node, NodeList):
Loading
Loading
@@ -1643,9 +1647,9 @@ class LineProxyList(ProxyList):
{"type": "endl", "formatting": [], "value": "\n", "indent": " "})
 
def _synchronise(self):
log("Before synchronise, self.data = '%s' + '%s'", self.first_blank_lines, self.data)
log("Before synchronise, self.data = '%s' + '%s'", self.first_blank_lines, self.node_list)
super(LineProxyList, self)._synchronise()
log("After synchronise, self.data = '%s' + '%s'", self.first_blank_lines, self.data)
log("After synchronise, self.data = '%s' + '%s'", self.first_blank_lines, self.node_list)
 
def _build_inner_list(self, node_list):
result = []
Loading
Loading
Loading
Loading
@@ -8,8 +8,8 @@ import pytest
import redbaron
from redbaron import RedBaron
 
redbaron.DEBUG = True
# (alekum): switch off debug mode, to reproduce a bug with __repr__ implicit recursion
redbaron.DEBUG = False
 
def assert_with_indent(left, right):
# Replace is not strictly necessary but shows indents
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment