amn / csspring

A CSS parsing library
GNU General Public License v3.0
1 stars 0 forks source link

Unbound local variable error in the `syntax.parsing.consume_simple_block` procedure when running Python with `-O` (disable debugging) #3

Closed amn closed 1 month ago

amn commented 2 months ago

The issue is caused by token variable declaration implemented with the walrus (:=) operator as part of the assert statement -- when the statement is elided as Python runs with -O, the subsequent statement(s) (1) accessing token correctly cause raising of UnboundLocalError trying to access token.

amn commented 1 month ago

Fixed with 899509a9f1e03fbeb0e3c75bf1377c7d3fc7164a.