@@ -1094,11 +1094,11 @@ class StringNode(PyConstNode):
self.check_for_coercion_error(dst_type,fail=True)
# this will be a unicode string in Py3, so make sure we can decode it
ifself.value.encoding:
ifself.value.encodingandself.unicode_valueisNone:
encoding=self.value.encoding
try:
self.value.decode(encoding)
exceptUnicodeDecodeError:
except(UnicodeDecodeError,AttributeError):
error(self.pos,"String decoding as '%s' failed. Consider using a byte string or unicode string explicitly, or adjust the source code encoding."%encoding)