Commit 20de226f authored by Stefan Behnel's avatar Stefan Behnel

fix identifier decoding check

parent e13327cb
...@@ -926,8 +926,8 @@ class StringNode(PyConstNode): ...@@ -926,8 +926,8 @@ class StringNode(PyConstNode):
self.check_for_coercion_error(dst_type, fail=True) self.check_for_coercion_error(dst_type, fail=True)
# this will be a unicode string in Py3, so make sure we can decode it # this will be a unicode string in Py3, so make sure we can decode it
if not self.is_identifier: if self.value.encoding:
encoding = self.value.encoding or 'UTF-8' encoding = self.value.encoding
try: try:
self.value.decode(encoding) self.value.decode(encoding)
except UnicodeDecodeError: except UnicodeDecodeError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment