#6 ✓resolved
juti_n (at yahoo)

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

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.

New-ticket Create new ticket

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

Shared Ticket Bins

People watching this ticket

Pages