From: Stefan Behnel Date: Wed, 17 Feb 2010 08:15:53 +0000 (+0100) Subject: fix str default values in embedded signatures in Py3 X-Git-Tag: 0.13.beta0~340^2~9^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=07dbdc36557b8cd8272d5e92c1350284d133e755;p=cython.git fix str default values in embedded signatures in Py3 --- diff --git a/Cython/Compiler/AutoDocTransforms.py b/Cython/Compiler/AutoDocTransforms.py index c41bbbf1..13859eac 100644 --- a/Cython/Compiler/AutoDocTransforms.py +++ b/Cython/Compiler/AutoDocTransforms.py @@ -20,7 +20,7 @@ class EmbedSignature(CythonTransform): try: denv = self.denv # XXX ctval = default_val.compile_time_value(self.denv) - repr_val = '%r' % ctval + repr_val = repr(ctval) if isinstance(default_val, ExprNodes.UnicodeNode): if repr_val[:1] != 'u': return u'u%s' % repr_val @@ -28,8 +28,8 @@ class EmbedSignature(CythonTransform): if repr_val[:1] != 'b': return u'b%s' % repr_val elif isinstance(default_val, ExprNodes.StringNode): - if repr_val[:1] in ('u', 'b'): - repr_val[1:] + if repr_val[:1] in 'ub': + return repr_val[1:] return repr_val except Exception: try: