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

UnboundLocalError in parser.py #81

Open
jkeaton opened this issue Jan 4, 2016 · 0 comments
Open

UnboundLocalError in parser.py #81

jkeaton opened this issue Jan 4, 2016 · 0 comments

Comments

@jkeaton
Copy link

jkeaton commented Jan 4, 2016

Line 249 of file lesscpy/lesscpy/lessc/parser.py as of commit 295afcf raises UnboundLocalError when none of the 3 conditions above it are met. Changing lines 239-249 to the following would fix it:

ipath = fe = None
if isinstance(p[3], str):
    ipath = utility.destring(p[3])
elif isinstance(p[3], list):
    p[3] = Import(p[3], p.lineno(4)).parse(self.scope)
    ipath = utility.destring(p[3])
elif isinstance(p[3], Call):
    # NOTE(saschpe): Always in the form of 'url("...");', so parse it
    # and retrieve the inner css_string. This whole func is messy.
    p[3] = p[3].parse(self.scope)  # Store it as string, Statement.fmt expects it.
    ipath = utility.destring(p[3][4:-1])
else:
    ipath = utility.destring(str(p[3]))
fn, fe = os.path.splitext(ipath)
@jkeaton jkeaton changed the title UnboundLocalError UnboundLocalError in parser.py Jan 4, 2016
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

1 participant