diff options
author | David Malcolm <dmalcolm@redhat.com> | 2010-03-05 19:06:29 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2010-03-05 19:06:29 -0500 |
commit | e4c495a8b6d9727de99b35bddf70f2c942e7f8b9 (patch) | |
tree | 0b41afa08d135b80f55195eb9cefb4a8bd643fa7 /lib2to3c/repr.cocci | |
parent | 234a10d5bc133f9963db58fd4c08715fe43c2b94 (diff) | |
download | 2to3c-master.tar.gz 2to3c-master.tar.xz 2to3c-master.zip |
Diffstat (limited to 'lib2to3c/repr.cocci')
-rw-r--r-- | lib2to3c/repr.cocci | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib2to3c/repr.cocci b/lib2to3c/repr.cocci new file mode 100644 index 0000000..dfa1ef4 --- /dev/null +++ b/lib2to3c/repr.cocci @@ -0,0 +1,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); +} |