Unassigned variables cause UnboundLocalError in Kotoba
Reported by juti_n (at yahoo) | February 12th, 2011 @ 09:13 PM | in Yotsuba 3.1
Affected Version: Yotsuba 3.0 / Kotoba 2.0
Description:
File "/Users/jnopporn/Code/www-v11/yotsuba/lib/kotoba.py", line 253, in data max_depth = 'max_depth' in kwargs and (base.isNaturalNumber(max_depth) and max_depth - 1 or None) or None UnboundLocalError: local variable 'max_depth' referenced before assignment
Reproductive Steps: Attempt to call DOMElement.data()
Solution (Proposal): From
max_depth = 'max_depth' in kwargs and (base.isNaturalNumber(max_depth) and max_depth - 1 or None) or None
to
max_depth = None
if 'max_depth' in kwargs and base.isNaturalNumber(max_depth):
max_depth = max_depth - 1
Comments and changes to this ticket
-
juti_n (at yahoo) February 13th, 2011 @ 01:28 AM
- State changed from new to resolved
Removed max_depth as it was unnecessary.
-
juti_n (at yahoo) February 13th, 2011 @ 01:29 AM
- Milestone changed from Yotsuba 4 to Yotsuba 3.1
- Milestone order changed from 4 to 0
-
juti_n (at yahoo) February 14th, 2011 @ 09:18 PM
- Tag set to yotsuba 3, defect
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Library and Software Development Framework to enable fast and free-style development and deployment in Python