summaryrefslogtreecommitdiff
path: root/Python/peephole.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-09-28 07:41:54 +0200
committerMartin v. Löwis <martin@v.loewis.de>2011-09-28 07:41:54 +0200
commitd1d013c01c268d869597b35cbcd8b5d7c5baf2ae (patch)
treeac42dafc2067cce1d896e613738a7bd263601d36 /Python/peephole.c
parent5292805e03b80f41e608ea20ce6bc3f64d6566dd (diff)
downloadcpython-d1d013c01c268d869597b35cbcd8b5d7c5baf2ae.tar.gz
Implement PEP 393.
Diffstat (limited to 'Python/peephole.c')
-rw-r--r--Python/peephole.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/Python/peephole.c b/Python/peephole.c
index 705622f18e..5d536779ac 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -183,24 +183,6 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts, PyObject **ob
break;
case BINARY_SUBSCR:
newconst = PyObject_GetItem(v, w);
- /* #5057: if v is unicode, there might be differences between
- wide and narrow builds in cases like '\U00012345'[0].
- Wide builds will return a non-BMP char, whereas narrow builds
- will return a surrogate. In both the cases skip the
- optimization in order to produce compatible pycs.
- */
- if (newconst != NULL &&
- PyUnicode_Check(v) && PyUnicode_Check(newconst)) {
- Py_UNICODE ch = PyUnicode_AS_UNICODE(newconst)[0];
-#ifdef Py_UNICODE_WIDE
- if (ch > 0xFFFF) {
-#else
- if (ch >= 0xD800 && ch <= 0xDFFF) {
-#endif
- Py_DECREF(newconst);
- return 0;
- }
- }
break;
case BINARY_LSHIFT:
newconst = PyNumber_Lshift(v, w);