cpython: 6bd21268876e (original) (raw)

--- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -307,6 +307,11 @@ class TestPy3KWarnings(unittest.TestCase w.reset() self.assertWarning(sequenceIncludes(range(3), 2), w, seq_warn)

+ class TestStdlibRemovals(unittest.TestCase):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 2.7.8? Core and Builtins ----------------- +- Issue #19656: Running Python with the -3 option now also warns about

--- a/Python/ast.c +++ b/Python/ast.c @@ -37,7 +37,7 @@ static expr_ty ast_for_testlist_comp(str static expr_ty ast_for_call(struct compiling *, const node *, expr_ty); static PyObject *parsenumber(struct compiling *, const char *); -static PyObject *parsestr(struct compiling *, const char *); +static PyObject *parsestr(struct compiling *, const node *n, const char *); static PyObject *parsestrplus(struct compiling *, const node *n); #ifndef LINENO @@ -3444,13 +3444,14 @@ decode_unicode(struct compiling *c, cons

if (isalpha(quote) || quote == '_') { if (quote == 'u' || quote == 'U') { @@ -3460,6 +3461,7 @@ parsestr(struct compiling *c, const char if (quote == 'b' || quote == 'B') { quote = *++s; unicode = 0;

@@ -3489,6 +3491,16 @@ parsestr(struct compiling *c, const char return NULL; } }

#ifdef Py_USING_UNICODE if (unicode || Py_UnicodeFlag) { return decode_unicode(c, s, len, rawmode, c->c_encoding); @@ -3531,11 +3543,11 @@ parsestrplus(struct compiling *c, const PyObject *v; int i; REQ(CHILD(n, 0), STRING);