The patches are adding deprecation warnings for back ticks and <>
#include "fileobject.h"
#include "codecs.h"
#include "abstract.h"
+#include "pydebug.h"
#endif /* PGEN */
extern char *PyOS_Readline(FILE *, FILE *, char *);
break;
case '<':
switch (c2) {
- case '>': return NOTEQUAL;
+ case '>':
+ {
+#ifndef PGEN
+ if (Py_Py3kWarningFlag)
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "<> not supported in 3.x", 1);
+#endif
+ return NOTEQUAL;
+ }
case '=': return LESSEQUAL;
case '<': return LEFTSHIFT;
}
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;
expr_ty expression = ast_for_testlist(c, CHILD(n, 1));
if (!expression)
return NULL;