Commit 0510cac9 authored by Stefan Behnel's avatar Stefan Behnel

always convert byte-docstrings into unicode strings

parent cf8f78c8
...@@ -8,7 +8,7 @@ from Scanning import PyrexScanner, FileSourceDescriptor ...@@ -8,7 +8,7 @@ from Scanning import PyrexScanner, FileSourceDescriptor
import Nodes import Nodes
import ExprNodes import ExprNodes
from ModuleNode import ModuleNode from ModuleNode import ModuleNode
from Errors import error, InternalError from Errors import error, warning, InternalError
from Cython import Utils from Cython import Utils
import Future import Future
...@@ -2151,9 +2151,14 @@ def p_property_decl(s): ...@@ -2151,9 +2151,14 @@ def p_property_decl(s):
def p_doc_string(s): def p_doc_string(s):
if s.sy == 'BEGIN_STRING': if s.sy == 'BEGIN_STRING':
_, result = p_cat_string_literal(s) pos = s.position()
kind, result = p_cat_string_literal(s)
if s.sy != 'EOF': if s.sy != 'EOF':
s.expect_newline("Syntax error in doc string") s.expect_newline("Syntax error in doc string")
if kind != 'u':
# warning(pos, "Python 3 requires docstrings to be unicode strings")
if kind == 'b':
result.encoding = None # force a unicode string
return result return result
else: else:
return None return None
......
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