parse_file: fix "decoded" may not be initialized issue
if "encoding" parameter not None.
This commit is contained in:
1 parent
7b28a8d7e4
commit
fe726d2ee3
1 file changed
+4
-4
@@ -384,10 +384,10 @@ class SGF:
|
||||
encoding = match[1].decode("ascii", errors="ignore")
|
||||
else:
|
||||
encoding = cls.DEFAULT_ENCODING
|
||||
try:
|
||||
decoded = bin_contents.decode(encoding=encoding, errors="ignore")
|
||||
except LookupError:
|
||||
decoded = bin_contents.decode(encoding=cls.DEFAULT_ENCODING, errors="ignore")
|
||||
try:
|
||||
decoded = bin_contents.decode(encoding=encoding, errors="ignore")
|
||||
except LookupError:
|
||||
decoded = bin_contents.decode(encoding=cls.DEFAULT_ENCODING, errors="ignore")
|
||||
if is_ngf:
|
||||
return cls.parse_ngf(decoded)
|
||||
if is_gib:
|
||||
|
||||
Reference in new issue
Block a user