Skip to content

Commit 925a8d4

Browse files
committed
we may not even enter the lopp which means the 'i' variable wouldn't be set
1 parent e2c1462 commit 925a8d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ws4py/utf8validator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def validate(self, ba):
104104
"""
105105
state = self.state
106106
DFA = Utf8Validator.UTF8VALIDATOR_DFA
107+
i = 0 # make sure 'i' is set if when 'ba' is empty
107108
for i, b in enumerate(ba):
108109
## optimized version of decode(), since we are not interested in actual code points
109110
state = DFA[256 + (state << 4) + DFA[b]]

0 commit comments

Comments
 (0)