summaryrefslogtreecommitdiffstats
path: root/lib2to3c/repr.cocci
blob: dfa1ef42eaa9668ed922484dc1600c1324c6cd99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// tp_repr functions should return unicode in py3k
// FIXME: need to restrict to just tp_repr functions:
@@
type T;
function FN_repr;
expression E;
@@
PyObject *
FN_repr(T *self)
{
     ...     
-    return PyString_FromString(E);
+    return PyUnicode_FromString(E);
}

@@
type T;
function FN_repr;
expression E1, E2;
@@
PyObject *
FN_repr(T *self)
{
     ...     
-    return PyString_FromFormat(E1, E2);
+    return PyUnicode_FromFormat(E1, E2);
}