Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subclassing Line causes infinite recursion abort #17

Closed
sndgeek opened this issue Jan 4, 2017 · 1 comment
Closed

Subclassing Line causes infinite recursion abort #17

sndgeek opened this issue Jan 4, 2017 · 1 comment

Comments

@sndgeek
Copy link

sndgeek commented Jan 4, 2017

While trying the workaround for Issue #3 , I subclassed Line and implemented the start of an override for get_stylesheet().

def get_stylesheet( self ):
	ss = super( PerfLine, self ).get_stylesheet()
            ...

Unfortunately, this code in Line.py makes any further usage crash:

def calculate_left_margin(self):
	super(self.__class__, self).calculate_left_margin()
	label_left = len(self.fields[0]) / 2 * self.font_size * 0.6
	self.border_left = max(label_left, self.border_left)

b/c self.class is now my subclass so this method ends up calling itself until it aborts via stack recursion hell.

Seems to work fine if I change it to "super(Line, self).calculate_left_margin()".

jaraco added a commit that referenced this issue Jan 4, 2017
jaraco added a commit that referenced this issue Jan 4, 2017
@jaraco
Copy link
Owner

jaraco commented Apr 9, 2017

Fixed in 3.4.4.

@jaraco jaraco closed this as completed Apr 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants