break;
case '<':
switch (c2) {
- case '>':
- {
-#ifndef PGEN
- if (Py_Py3kWarningFlag)
- PyErr_WarnEx(PyExc_DeprecationWarning,
- "<> not supported in 3.x", 1);
-#endif
- return NOTEQUAL;
- }
+ case '>': return NOTEQUAL;
case '=': return LESSEQUAL;
case '<': return LEFTSHIFT;
}
{
int c2 = tok_nextc(tok);
int token = PyToken_TwoChars(c, c2);
+#ifndef PGEN
+ if (token == NOTEQUAL && c == '<') {
+ if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
+ "<> not supported in 3.x",
+ tok->filename, tok->lineno,
+ NULL, NULL)) {
+ return ERRORTOKEN;
+ }
+ }
+#endif
if (token != OP) {
int c3 = tok_nextc(tok);
int token3 = PyToken_ThreeChars(c, c2, c3);
return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena);
}
case BACKQUOTE: { /* repr */
- if (Py_Py3kWarningFlag &&
- PyErr_Warn(PyExc_DeprecationWarning,
- "backquote not supported in 3.x") < 0)
- return NULL;
+ if (Py_Py3kWarningFlag) {
+ if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
+ "backquote not supported in 3.x",
+ "<unknown>", LINENO(n),
+ NULL, NULL)) {
+ ; //return NULL;
+ }
+ }
expr_ty expression = ast_for_testlist(c, CHILD(n, 1));
if (!expression)
return NULL;