Skip to content

Commit f765fb9

Browse files
committed
Fix an UnboundLocalError under Python 2
`email` was not yet there, so I assume you meant `line` :) This fixes the following error for me: ``` Traceback (most recent call last): File "email_validator/__init__.py", line 352, in <module> main() File "email_validator/__init__.py", line 298, in main if sys.version_info < (3,): email = email.decode("utf8") # assume utf8 in input UnboundLocalError: local variable 'email' referenced before assignment ```
1 parent 090b1e4 commit f765fb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

email_validator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def main():
295295
# Strip newlines and skip blank lines and comments.
296296
line = line.strip()
297297
if line == "" or line[0] == "#": continue
298-
if sys.version_info < (3,): email = email.decode("utf8") # assume utf8 in input
298+
if sys.version_info < (3,): line = line.decode("utf8") # assume utf8 in input
299299

300300
# Pick up "[valid]"/"[invalid]" lines.
301301
if line == "[valid]":

0 commit comments

Comments
 (0)